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

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -