I’ve read about intents in android but here goes my question. I’d like to launch an app on my android phone with the click of a link in the web browser. Example:
If the link is “mycam://http://camcorder.com“, “mycam://” acts as some kind of “tag” to launch my app but I’d like to pass “http://camcorder.com” as a string to that app on start.
Help please!
Thanks!
There is a method in the Browser app source code, :
After a url clicked and it’s not yet starting to load:
converts the url to intent
if it don’t start with market:// (or some predefined schemes), try startActivityIfNeeded()
It’s very useful information! I re-play the situation in some simple code:
The result will provide clues for me to write an activity with the intent-filter:
PS. don’t forget the
android.intent.category.DEFAULT.Finally, your Activity can invoke by
mycam://yourscheme.