简体   繁体   中英

Issue in open my application from browser url in android

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 im not able to click that button so i can not navigate to my application so any idea how can i solve this problem ?

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>

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM