7

我通过将其添加到我在 android 清单中的活动中为我的应用程序制作了自定义方案:

 <activity android:name=".TabHostActivity"
              android:label="@string/app_name"
               android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
         <intent-filter>
            <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.action.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.LAUNCHER" />
                 <data  android:scheme="myscheme" />
        </intent-filter>
    </activity>

当我在 android 浏览器中写入“myscheme://”时,它会打开我的应用程序(在某些设备上)。问题是这不适用于三星galaxy s和Xperia play。它只在 google 上搜索 myscheme://。

有谁知道这里有什么问题?

任何帮助将不胜感激 :)

4

1 回答 1

0

浏览器通常会搜索一个术语或在其前面添加“http://”(如果它尚不存在)。我的猜测是这就是这里发生的事情。

如果您创建一个带有指向 myscheme://something 的链接的 HTML 页面,您的应用程序应该会显示在选择器列表中。

像这样的东西: <a href="myscheme://it_worked"> click this link </a>

于 2013-07-13T04:11:46.993 回答