Issue in open my application from browser url in android

会有一股神秘感。 提交于 2019-12-23 04:41:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!