In Android, you can call the included browser, or specify a browser to open a link. Just pass in a uri, which can be the link address.
Start the default android browser
In Android programs, we can start the system's default browser by sending implicit Intent. If the phone itself has multiple browsers installed and does not have a default browser set, the system will let the user choose which browser to use to open the connection.
Uri uri = (""); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);
You can use the above three lines of code to call the system's own browser.
Start the specified browser and open it
In Android programs, we can start the specified browser by sending an explicit Intent. For example, I have installed multiple browsers on my phone: QQ browser, Chrome browser, and uc browser. I can specify to open this link with a browser. For example, open the QQ browser as follows:
Uri uri = (""); Intent intent = new Intent(Intent.ACTION_VIEW,uri); //("","");//Open UC browser("","");//Open QQ browserstartActivity(intent);
To open it with the uc browser, you just need to comment out the line of code that opens the QQ browser, and then opens the uc browser, and uncheck it.
Priority use
The first type is recommended, allowing users to choose which browser to open. The second type will be used unless there are special needs.
The second type of error rate is relatively high. If you want to open it with the uc browser, but the new version of the uc browser does not use the original package name, you will not be able to open it at this time. There are also problems with uc browser compatibility. I will only display the UC homepage when I jumped, instead of directly opening the http link I provided. But QQ browser does not have this problem.
Summarize
The above is the implementation method of opening web pages by the editor who introduced the Android calling system's own browser. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!