开发者

Receive explicit intent. Android

Is it possible to receive an explicit intent with the component option set? Example:

Starting activity: Intent { action=android.intent.action.VIEW data=http://example.org flags=0x10000000 comp={com.android.browser/com.android.browser.BrowserActivity} }

The reason why i want to this this is because i want receive this intent above, launch another browser than开发者_如何学运维 the default one, and drop the intent before it starts the default browser. In another words, i want to make another browser the default one.

If this is impossible, any other ideas how i can accomplish this?

Thanks!


1) You can explicitly launch alternative browser by calling something like startActivity(new Intent(this, OtherBrowser.class)) from Activity.
2) You can't override the default browser, but you can provide a browser alternative that user could choose when opening http://something. Just have a look at intent-filters that the default Browser declares (from Android sources).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜