【发布时间】:2012-10-24 05:40:08
【问题描述】:
我已经在 manifest.xml 中实现了 URL Scheme 的代码,如下所示。此代码不适用于任何浏览器。
<activity
android:name=".Event"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan|stateAlwaysVisible" >
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="xyz" />
</intent-filter>
</activity>
以下代码仅适用于默认浏览器。
<activity
android:name=".Event"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan|stateAlwaysVisible" >
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="xyz" />
</intent-filter>
</activity>
所以,请给我一个解决方案,让我可以在任何浏览器上使用自定义 URL 方案,或者我必须为这个问题在上面的代码中更改什么。
【问题讨论】:
-
你确定不是相反。第一个代码有效,第二个无效?参考我的问题stackoverflow.com/q/13042278/1503155,我想我们也有同样的问题。
标签: android url url-scheme