android - Open Chrome App with URL -


Is there a way to open Chrome apps from the default Android browser on Android? I'm able to open the app, but it does not redirect the user to the correct page. This is what I tried:

  & lt; A href = "googlechrome: //www.toovia.com" & gt;   

I see that I may have to make an intention URL, but I was hoping that there is a much easier way than that.

This is a web page and there is no web view involved in it.

Yes, but if it is not installed on the system you will participate in the ActivityNotFound exception if it is not available , Then you should launch via the normal browser:

  string URL = "http: // mysuperwebsite"; Try {intent i = new intent ("android.intent.action.MAIN"); I.setComponent (ComponentName.unflattenFromString ("com.android.chrome/com.android.chrome.Main")); I.addCategory ("android.intent.category.LAUNCHER"); I.setData (Uri.parse (url)); startActivity (i); } Catch (ActivityNotFoundException E) {// Chrome is not installed. I = new intent (Intent.ACTION_VIEW, Uri.parse (url)); startActivity (i); }    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -