5

我已经阅读了所有其他关于这样做的帖子,但没有一个能解决我的问题。显然,该方案必须是 http 的链接,否则它在短信中不可点击。

如果我使用其他人发布的内容并单击我提供的 http 链接:

打开网址,添加到书签,复制消息文本

如果我打开 URL,我只能选择浏览器,没有别的。

我需要它来打开应用程序,而不是提供浏览器选项。

请帮忙。

XML:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <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.catagory.DEFAULT"/> 
            <category android:name="android.intent.catagory.BROWSABLE"/>    
            <data android:scheme="http" android:host="starttestapp.com"/>
        </intent-filter>
    </activity>
</application>

4

1 回答 1

3

If you copy pasted your code, then you have a spelling error:

catagory should be category like this:

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> 
于 2013-04-17T19:31:51.830 回答