This code should do:
Read full article from jquery - Is there any way in Android to force open a link to open in Chrome? - Stack Overflowtry { Intent i = new Intent("android.intent.action.MAIN"); i.setComponent(ComponentName.unflattenFromString("com.android.chrome/com.android.chrome.Main")); i.addCategory("android.intent.category.LAUNCHER"); i.setData(Uri.parse("http://mysuperwebsite")); startActivity(i); } catch(ActivityNotFoundException e) { // Chrome is probably not installed }
No comments:
Post a Comment