I want to realize the app for using the web app in Chrome.

Asked 2 years ago, Updated 2 years ago, 92 views

Is it possible to implement the following applications?

The bottom line is the app for using the web app in Chrome.

android google-chrome

2022-09-30 10:44

1 Answers

I don't have an Android machine at hand, so I haven't verified it yet, but I think the processing can be branched with or without Chrome using the following code.
Wouldn't it be difficult to say that if a particular domain number 4 had already been opened?

String urlString="http://www.google.com";
Intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString)));
int.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
int.setPackage("com.android.chrome");
try{
    // Open in Chrome if Chrome is installed
    startActivity (intent);
} catch(ActivityNotFoundExceptionex){
    // Download if Chrome is not found
    startActivity(newIntent(Intent.ACTION_VIEW,    
        Uri.parse("market://details?id=com.android.chrome"));
}


2022-09-30 10:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.