Using Chooserintent
Private voidstartimplicitactivation () {log.i (TAG,"Entered Startimplicitactivation ()"); //Todo-create a base intent for viewing a URL//(hint:second parameter uses Uri.parse ())Uri Myuri =Uri.parse (URL); Intent baseintent=NewIntent (Intent.action_view, Myuri); //Todo-create A chooser intent, for choosing which Activity//Would carry out the baseintent//(Hint:use the Intent class ' Createchooser () method)Intent chooserintent = Intent.createchooser (baseintent, "Display this URL via:"); LOG.I (TAG,"Chooser Intent Action:" +chooserintent.getaction ()); //Todo-start The Chooser Activity, using the Chooser intentstartactivity (chooserintent); }
Set Intent-filter
1 This 2 Activity would accept Intentswith the3 action "Android.intent.action.VIEW" and with "http" 4 schemed URL--5 <intent-filter>6 <action android:name= " Android.intent.action.VIEW "/>7 <category android:name=" Android.intent.category.DEFAULT "/ >8 <data android:scheme= "http"/>9 </intent-filter>
Android Intent filter Browser app settings, how to use Choose-box to select apps