0

I really can't find anything for this, maybe I'm using the wrong keywords. Hope you can help anyway. I developed an application which has the task to navigate a website in a easy way from mobile, but now I want it to be recognised outside from other applications as default for certain links. For example: An email arrives from this website on your phone, when you click on the link in it, which rediricts to a page on that website, I want that the OS asks me to choose which application I want to use, in this case Google Chrome or my application. Only thing I was able to do was to make it open YouTube links with the YouTube application externally, not viceversa from outside

Thanks fot the help and the idea, this is how i made it work: Manifest.xml

<intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
     <action android:name="android.intent.action.VIEW" />
     <category android:name="android.intent.category.DEFAULT" />
     <category android:name="android.intent.category.BROWSABLE" />
     <data
         android:host="www.mywebsite"
         android:scheme="https"
     />

Mainactivity.java (inside OnCreate)

WebView myWebView = (WebView) findViewById(R.id.webView);
Intent intent = getIntent();
Uri data = intent.getData();
if (data!=null) {
    myWebView.loadUrl(String.valueOf(data)); //Load given link from external app
} else {
    myWebView.loadUrl("http://www.mywebsite"); //Load homescreen 
}
ivpavici
  • 1,117
  • 2
  • 19
  • 30
seanwlk
  • 21
  • 6
  • Have you read about intent filters for html at https://developer.android.com/guide/components/intents-common.html#Browser? – k3b Feb 01 '16 at 12:51
  • From what i'm seeing in this, this is just in-app stuff, i need that exeternal application link to mine, one more example is the stackexchange on, which pops up if you try to open a stackoverflow link from google or other sites, it gets immediatly recognised by te system as an application made for that site. – seanwlk Feb 01 '16 at 13:50
  • you have to implement an activity with the referenced "http" intent-filter and then your activity will be presented in the chooser, if a user wants to open a "http:...." url – k3b Feb 01 '16 at 14:19

0 Answers0