Let's take per say the following manifest:
<intent-filter>
<data scheme="myscheme"
host="myhost">
</data>
<action name="android.intent.action.VIEW">
</action>
<category name="android.intent.category.DEFAULT">
</category>
<category name="android.intent.category.BROWSABLE">
</category>
</intent-filter>
I could launch the activity which under the above intent filter is declared by redirecting the browser to:
myscheme://myhost?param1=param1¶m2=param2
However, I'm struggling with understanding if it is possible to do the same redirection, only with additional extras that would be received programmatically with:
myextra = getIntent().getStringExtra('myextra')
Any help would be very much appreciated.
One could use "intent scheme URL" in order to send more information like extra objects and actions when redirecting to a custom intent scheme URL via javascript or HTML.
intent://foobar/#Intent;action=myaction1;type=text/plain;S.xyz=123;end
Although this method doesn't actually answer the question as the scheme part is destined to always be "intent", this is a possible way to send intents from browsers with extra object or actions.
See more extensive information in the following report:
http://www.mbsd.jp/Whitepaper/IntentScheme.pdf
Or use the chrome documentation:
https://developer.chrome.com/multidevice/android/intents
This is how I overcome this issue,
I developed my own browser and made browsable like you do
Uri data = getIntent().getData();
if(data == null) { // Opened with app icon click (without link redirect)
Toast.makeText(this, "data is null", Toast.LENGTH_LONG).show();
}
else { // Opened when a link clicked (with browsable)
Toast.makeText(this, "data is not null", Toast.LENGTH_LONG).show();
String scheme = data.getScheme(); // "http"
String host = data.getHost(); // "twitter.com"
String link = getActualUrl(host);
webView.loadUrl(link);
Toast.makeText(this,"scheme is : "+scheme+" and host is : "+host+ " ",Toast.LENGTH_LONG).show();
}
I think you are looking for this functions
data.getQueryParameter(String key);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With