In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Android how to call the system's own browser to open the web page", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Android how to call the system's own browser to open the web page"!
In Android, you can call your own browser, or specify a browser to open a link. You only need to pass in a uri, which can be a link address.
Launch the android default browser
In the Android program, we can launch the default browser of the system by sending an implicit Intent. If the phone itself has multiple browsers installed and no default browser is set, the system will allow the user to choose which browser to use to open the connection.
Uri uri = Uri.parse ("https://www.baidu.com");Intent intent = new Intent (Intent.ACTION_VIEW, uri); startActivity (intent))
Using the above three lines of code, you can call the system's own browser.
Launch the specified browser to open
In the Android program, we can launch the specified browser by sending an explicit Intent. For example, my phone installed multiple browsers: QQ Browser, chrome browser, uc browser. I can specify a browser to open this link. For example, open QQ Browser's code as follows:
Uri uri = Uri.parse ("https://www.baidu.com");Intent intent = new Intent (Intent.ACTION_VIEW,uri); / / intent.setClassName (" com.UCMobile "," com.uc.browser.InnerUCMobile "); / / Open UC browser intent.setClassName (" com.tencent.mtt "," com.tencent.mtt.MainActivity "); / / Open QQ Browser startActivity (intent)
To open it with a uc browser, you just need to comment out the line of code that opens QQ Browser, and then open the line of code in the uc browser to unwatch.
Priority use
The first is recommended, leaving users to choose which browser to use to open it. The second is used only if there is a special need.
The second kind of error rate is relatively high, if you want to use uc browser to open, but the new version of uc browser does not use the original package name, at this time you will not be able to open. There is also a problem with the compatibility of uc browsers. When I jump over, I will only display the UC home page, instead of directly opening the http link I provided. But QQ Browser does not have this problem.
At this point, I believe you have a deeper understanding of "Android how to call the system's own browser to open the web page". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.