根据URL打开特定应用

Meg*_*hah 5 android android-manifest android-intent

我想打开一个应用程序,如果网址

例如,如果此人打开:http://www.example.com/id=100,我想解析example.com并显示选项以使用我的应用程序打开它.

youtube使用相同的功能,如果你点击youtube链接,它会询问你是想用youtube打开它还是直接播放youtube视频

rek*_*ire 7

您可以data specification使用http架构和要使用应用打开的域添加到intent过滤器.

<intent-filter ... >
    <data android:scheme="http" android:host="example.com" />
    ...
</intent-filter>
Run Code Online (Sandbox Code Playgroud)