2

i know my question is been asked for many times here but i tried all the answers and still have the problem my problem is that i want my application to be opened throw url from the mobile browser

here is what i write in the mainfeast.xml file

 <activity android:name=".Login" android:label="@string/app_name" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="" android:scheme="mpay2park" /> </intent-filter> 

and still can't solve this issue what I want to know that if I should write anything in the Login.java activity or not and what is the URLthat I should to write for this

Thank you

7
  • "and still can't solve this issue" -- and the issue is, what, precisely? If the issue you failed to write is that your activity is not a choice for mpay2park:// URLs, I would delete android:host="". Commented Aug 30, 2012 at 23:58
  • the issue that the url didn't open my app Commented Aug 31, 2012 at 0:04
  • Then delete android:host="" and try again. If it still does not work, show a sample URL that is failing. Commented Aug 31, 2012 at 0:08
  • i write in the browser mpay2park:// and didn't work :( Commented Aug 31, 2012 at 0:11
  • @CommonsWare could you have a look a this question stackoverflow.com/questions/12175259/…. Sorry Basant, I dont know any other way to communicate with CommonWare. Commented Aug 31, 2012 at 1:07

2 Answers 2

2

You can use below manifest file to open abc://xyz.com from browser addressbar :

<?xml version="1.0" encoding="utf-8"?> 

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.sample.openfrombrowser.MainActivity" android:exported="true" android:label="@string/app_name" android:launchMode="singleInstance" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="xyz.com" android:scheme="abc" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="google.co.in" android:pathPrefix="/" android:scheme="http" /> <data android:host="www.google.co.in" android:pathPrefix="/" android:scheme="http" /> </intent-filter> </activity> </application> 

This will ask option(with your application name) in dialog to open this url.

hope so this will work for you.

Enjoy.

Sign up to request clarification or add additional context in comments.

Comments

1

I solve my problem ,here is what i write on mainfest file

 <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="mpay2park"/> </intent-filter> 

and I change the android browser and open my like from opera mini and it works perfect for me

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.