开发者

Receive explicit intent. Android

开发者 https://www.devze.com 2022-12-22 22:35 出处:网络
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.a

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

精彩评论

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

关注公众号