1

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!

4

1 回答 1

2

1)您可以通过调用类似startActivity(new Intent(this, OtherBrowser.class))from来显式启动替代浏览器Activity
2)您不能覆盖默认浏览器,但您可以提供用户在打开时可以选择的浏览器替代方案http://something。看看intent-filter默认浏览器声明的 s (来自 Android 源代码)。

于 2010-03-16T18:36:10.177 回答