I\'ve been trying to find out how to create an intent that will open the user\'s preferred browser without specifying the URL. I know how to open it by giving a specific URL
Try this:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_APP_BROWSER);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent.createChooser(intent, "Select Browser"));
}
else { //Popup a msg so as to know the reason of not opening the browser
Toast.makeText(this, "There is no Browser App", Toast.LENGTH_LONG).show();
}
Worked for me, hope for you also!