从短信中的链接启动android应用程序

Dav*_*vid 5 xml android

我已经阅读了所有其他帖子,但没有解决我的问题.显然该方案必须是链接的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>
Run Code Online (Sandbox Code Playgroud)

小智 3

如果您复制粘贴代码,则会出现拼写错误:

类别应该是这样的类别:

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> 
Run Code Online (Sandbox Code Playgroud)