Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何通过单击我的网站链接打开我的应用程序_Android_Url_Webview - Fatal编程技术网

Android 如何通过单击我的网站链接打开我的应用程序

Android 如何通过单击我的网站链接打开我的应用程序,android,url,webview,Android,Url,Webview,我有一个网站,我有一个简单的应用程序,有一个简单的网络视图 当每个人都安装了应用程序,他们可以点击链接到我的网站。这些应该在我的应用程序中打开 例如,如果我的网站是www.zoomit.ir,我点击https://www.zoomit.ir/2016/10/8/146994/todoist-tasklist-mobile-app/在insta或telegram等社交应用程序中,打开我的应用程序并显示该链接 如何使用午餐应用程序获取该链接,并在您的AndroidManifest.xml文件的web

我有一个网站,我有一个简单的应用程序,有一个简单的网络视图

当每个人都安装了应用程序,他们可以点击链接到我的网站。这些应该在我的应用程序中打开

例如,如果我的网站是
www.zoomit.ir
,我点击
https://www.zoomit.ir/2016/10/8/146994/todoist-tasklist-mobile-app/
在insta或telegram等社交应用程序中,打开我的应用程序并显示该链接


如何使用午餐应用程序获取该链接,并在您的
AndroidManifest.xml
文件的webview中显示该链接,请尝试在您的
中添加一个要从链接打开的意图过滤器

<activity
    android:name=".YourActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>

<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>

<data
    android:host="www.zoomit.ir"
    android:scheme="http"></data>

</intent-filter>
</activity>

现在您将拥有
url
=“www.zoomit.ir/example post”。使用此
url
加载webview

我想对我的网站的其他链接执行此操作,就像我在问题中写的那样…只需替换为该链接tnx,但我想通过单击
中以zoomit.ir/example-postadd
开头的所有链接打开我的应用程序,请参阅使用此修补程序前缀选项更新的应答…我的应用程序运行并在webview中打开该链接?官方页面上有文档
    String url;
    Intent intent = getIntent();
    String action = intent.getAction();
    Uri data = intent.getData();

 if (data!=null) {     
 webView.loadUrl(data.getScheme()+"://"+data.getHost()+data.getPath());
    }