鍍金池/ 問(wèn)答/Android/ oppo無(wú)法調(diào)起默認(rèn)外部瀏覽器

oppo無(wú)法調(diào)起默認(rèn)外部瀏覽器

在app內(nèi)調(diào)用oppo默認(rèn)瀏覽器時(shí),發(fā)現(xiàn)url重定向時(shí)無(wú)法調(diào)起, 我是這樣做的

Intent intent = Intent.parseUri(url, 0);
startActivity(intent);

測(cè)試發(fā)現(xiàn):
1.url換成“http://www.baidu.com”時(shí)能正常調(diào)起oppo的默認(rèn)瀏覽器
2.在oppo手機(jī)中設(shè)置其他第三方瀏覽器如UC瀏覽器、QQ瀏覽器等為默認(rèn)瀏覽器時(shí),均正常調(diào)起
3.拷貝帶有重定向的url,直接粘貼在oppo默認(rèn)瀏覽器的地址欄,可以正常打開(kāi)
4.使用Intent.createChooser調(diào)起選擇器時(shí),選擇oppo默認(rèn)瀏覽器時(shí)會(huì)打開(kāi)其他瀏覽器而非默認(rèn)
5.僅oppo無(wú)法調(diào)起,其他手機(jī)均正常?。?!

當(dāng)然,僅在測(cè)試中發(fā)現(xiàn)這種現(xiàn)象,不清楚直接原因是不是由url重定向引起的

注:以上說(shuō)的默認(rèn)瀏覽器都是指oppo手機(jī)自帶的oppo瀏覽器

測(cè)試手機(jī)是oppo R9m,Android版本號(hào)5.1,其他版本oppo應(yīng)該可重現(xiàn)

提供一個(gè)測(cè)試url=
"http://e.cn.miaozhen.com/r/k=2069565&p=7CPXn&dx=__IPDX__&rt=2&ns=__IP__&ni=__IESID__&v=__LOC__&xa=__ADPLATFORM__&tr=__REQUESTID__&mo=__OS__&m0=__OPENUDID__&m0a=__DUID__&m1=__ANDROIDID1__&m1a=__ANDROIDID__&m2=__IMEI__&m4=__AAID__&m5=__IDFA__&m6=__MAC1__&m6a=__MAC__&vo=3400c408&vr=2&o=http%3A%2F%2Fcnydigital.ferrero-praline.com.cn%2Fenter%3Fmz_ca%3D2069565%26mz_sp%3D7CPXn"

請(qǐng)問(wèn)是我調(diào)起方式不對(duì)還是有其他原因

回答
編輯回答
影魅

默認(rèn)瀏覽器:
Intent intent = new Intent(ACTION_VIEW, Uri.parse("網(wǎng)址"));
startActivity(intent);
外部瀏覽器:
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("鏈接"));
intent.setClassName("com.android.browser","com.android.browser.BrowserActivity"); startActivity(intent);

幾個(gè)常見(jiàn)
uc瀏覽器":"com.uc.browser", "com.uc.browser.ActivityUpdate"
opera:"com.opera.mini.android", "com.opera.mini.android.Browser"
qq瀏覽器:"com.tencent.mtt", "com.tencent.mtt.MainActivity"

2017年2月13日 10:44
編輯回答
陌上花
Uri uri = Uri.parse("http://www.google.com");
Intent intent = new Intent(ACTION_VIEW,uri);
startActivity(intent)

我這里一般是這么寫(xiě),這樣會(huì)調(diào)用瀏覽器

2017年5月22日 21:55