Android Intent filter Browser app settings, how to use Choose-box to select an app

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.