How to Avoid Loading Local Page in New Tab on Default Android Browser

独自空忆成欢 提交于 2019-12-06 15:31:47

Okay I found the fix. Basically, phones running 2.3 and lower use com.android.browser, with activity name com.android.browser.BrowserActivity. I believe in 3.0, ApplicationIDs were introduced.

Tablets still use the same Browser package name, but has an ApplicationID of com.android.browser, while ICS 4.0.2+ uses com.google.android.browser as the package name, and com.google.android.browser as the appId (same Activity name is used). So I just had to add that into my BrowserData.

After this, one must use the EXTRA_APPLICATION_ID flag on their browser intent to avoid the automatic opening of a new tab. More on that here: http://developer.android.com/reference/android/provider/Browser.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!