Android 如何从我的应用程序中选择浏览器?

Android 如何从我的应用程序中选择浏览器?,android,browser,android-intent,google-play,Android,Browser,Android Intent,Google Play,我有一个应用程序,其中有一个URL,我不想在WebView中加载它,而是使用 Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://VenomVendor.blogspot.com/search/label/Android")); startActivity(i); 我希望用户只能在特定浏览器中查看此网站,比如说我只想在Firefox中打开此URL。如果用户尚未安装,我必须告诉他下载Firefox&下载后,我必须加载此URL。

我有一个应用程序,其中有一个URL,我不想在WebView中加载它,而是使用

Intent i = new Intent(Intent.ACTION_VIEW, 
Uri.parse("http://VenomVendor.blogspot.com/search/label/Android"));
startActivity(i);
我希望用户只能在特定浏览器中查看此网站,比如说我只想在
Firefox
中打开此URL。如果用户尚未安装,我必须告诉他下载Firefox&下载后,我必须加载此URL。


注意:除非用户退出,否则我的应用程序不应退出。

1-检查程序包的退出

public booleand isPackageExists(String targetPackage){
        List<ApplicationInfo> packages;
        PackageManager pm;
            pm = getPackageManager();        
            packages = pm.getInstalledApplications(0);
            for (ApplicationInfo packageInfo : packages) {
        if(packageInfo.packageName.equals(targetPackage)) return true;
        }        
        return false;
    }
 like for default ComponentName arg will be  "com.android.browser", "com.android.browser.BrowserActivity"

 public void onClick(View v) {
             Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW);
             myWebLink.setComponent(new ComponentName("pkg","cls"));
             myWebLink.setData(Uri.parse("http://google.com"));
             startActivity(myWebLink);
       }