I'm working on an Android Coursera assignment to open a link within a browser using Implicit Intents. Within the code, I have a chooser method that gives one the option of which browser they would like to use. The problem though is that no browser appears using the CATEGORY Browsable option. Please look at the my code:
private void startImplicitActivation() {
Log.i(TAG, "Entered startImplicitActivation()");
// TODO - Create a base intent for viewing a URL
// (HINT: second parameter uses Uri.parse())
String url = "https://www.google.com";
Intent baseIntent = new Intent(Intent.CATEGORY_BROWSABLE, Uri.parse(url));
// TODO - Create a chooser intent, for choosing which Activity
// will carry out the baseIntent
// (HINT: Use the Intent class' createChooser() method)
Intent chooserIntent = new Intent(Intent.createChooser(baseIntent, "Select Your Browser"));
Log.i(TAG,"Chooser Intent Action:" + chooserIntent.getAction());
// TODO - Start the chooser Activity, using the chooser intent
startActivity(chooserIntent);
}
The resulting output when launched in an activity is below (I don't understand why no browsers come up):