简体   繁体   中英

Open Android app from browser

I am trying to open an Android app from a browser. I have read several StackOverflow threads describing a solution to the problem and this is what I have so far:

AndroidManifest.xml

<activity
        android:name="com.webviewtestapp.MainActivity"
        android:label="@string/app_name"
        android:exported="true" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.LAUNCHER" />
            <data android:scheme="Testapp" android:host="launch"/>
        </intent-filter>
</activity>

And this is the html <a href="Testapp://launch"> open testapp </a

I am using the Firefox browser in Chrome and clicking the link gives a message: Couldn't find an application to open this link

How do I fix this ?

Change:

<action android:name="android.intent.action.MAIN" />  

to:

<action android:name="android.intent.action.VIEW" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM