问题
Hello friends i wnat to open my application form browser url so in my menifest file below is my code
<activity
android:name=".Registration"
android:exported="true" >
<intent-filter>
<data
android:scheme="rentalandroid"/>
<category android:name="android.intent.category.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
and i want to open my application form Gmail application which is i receive one mail and inside that one button over here . so when i click on that button at that time my application should be open with registration screen which i set scheme for that so my PHP developer set url in on mail button click like below
My browser url is
http://secure.worldofrental.com/test/reg/36df6c69bf33fa39863e048a3018f899
<a href='.base_url("test/reg/".$row['accsesskey']).'>testlink</a>
Using above code in my gmail i m not able to click that button so i can not navigate to my application so any idea how can i solve this problem ?
回答1:
Your url scheme should be rentalandroid
for this to work:
Example: rentalandroid://mywebsite.com
<activity
android:name=".Registration"
android:exported="true" >
<intent-filter>
<data
android:scheme="rentalandroid"/>
<category android:name="android.intent.category.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
回答2:
Try to remove category for view :
<activity
android:name=".Registration"
android:exported="true" >
<intent-filter>
<data android:scheme="rentalandroid"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
来源:https://stackoverflow.com/questions/29982407/issue-in-open-my-application-from-browser-url-in-android