Android Blitz: There are multiple browsers installed on the system, can you specify a browser to access the specified page

Source: Internet
Author: User

First, launch the Android default browser in the Android program we can launch the system default browser by sending an implicit intent. If the phone itself has more than one browser installed and the default browser is not set, the system will let the user choose which browser to use to open the connection.
  
 
  1. Intent intent =newIntent();
  2. intent.setAction("android.intent.action.VIEW");
  3. Uri content_url =Uri.parse("http://www.163.com");
  4. intent.setData(content_url);
  5. startActivity(intent);
This way, Android will be able to invoke the default browser access from the phone.

Second, launch the specified browser in the Android program we can launch the specified browser by sending an explicit intent. Launch Android native browser
  
 
  1. Intent intent =newIntent();
  2. intent.setAction("android.intent.action.VIEW");
  3. Uri content_url =Uri.parse("http://www.163.com");
  4. intent.setData(content_url);
  5. intent.setClassName("com.android.browser","com.android.browser.BrowserActivity");
  6. startActivity(intent);
Just modify the corresponding application in Intent.setclassname ("Com.android.browser", "com.android.browser.BrowserActivity") PackageName And the activity to launch can launch other browsers to the UC browser ":" Com.uc.browser "," Com.uc.browser.ActivityUpdate "Opera browser:" Com.opera.mini.android "," Com.opera.mini.android.Browser "QQ Browser:" COM.TENCENT.MTT "," com.tencent.mtt.MainActivity "

From for notes (Wiz)

Android Blitz: There are multiple browsers installed on the system, can you specify a browser to access the specified page

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.