2016-11-22 51 views
1

我想在用户重定向浏览器上的URL时打开我的应用程序。如何使用URL打开应用程序

我的网址是:

http://www.subdomain.Domain.com/mytransactions

manifest.xml我写了这个:

<activity android:name="*.*.*.MyTransactions" > 

     <intent-filter > 
      <category android:name="android.intent.category.DEFAULT" /> 
      <action android:name="android.intent.action.VIEW"/> 
      <data 
       android:host="www.domain.com" 
       android:scheme="mytransactions" 
       android:pathPrefix="/subdomain"/> 
      <category android:name="android.intent.category.BROWSABLE" /> 

     </intent-filter> 

    </activity> 

但是当我在浏览器中输入这个网址我的应用程序没有启动。

+0

尝试改变'的android:pathPrefix = “/子”'到'机器人: pathPrefix = “/ mytransactions”'。 –

+0

我建议你使用DeepLinks –

回答

0

你需要做一些变化<data>

<data 
    android:host="www.subdomain.Domain.com" 
    android:pathPrefix="/mytransactions" 
    android:scheme="http" /> 

问题与您的代码是,你还没有定义scheme

+0

,并在哪里定义'mytransactions'? –

+0

检查更新后的答案,您需要在'pathPrefix'中提供它,并且还将'scheme'定义为'http' –

相关问题