簡述下一鍵跳轉(zhuǎn)至指定網(wǎng)站的錯(cuò)誤。
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=XXX:xxxxx },
這個(gè)其實(shí)是谷歌版本不再支持http了,而是https,所以你跳轉(zhuǎn)的網(wǎng)址一定要加上https.
? Intent intent=new Intent();
? intent.setAction("android.intent.action.VIEW");
? String netaddress=editurl.getText().toString();
? Uri content_url =Uri.parse("https://"+netaddress);
? intent.setData(content_url);
? startActivity(intent);
另外說下,官網(wǎng)提醒說可以在mannifest文件中,在<application/>中加上那句:android:usesCleartextTraffic="true",按照實(shí)際操作結(jié)果,這個(gè)可能沒用。