Android Question Open Chrome browser in sepesific page

Devv

Active Member
Licensed User
Longtime User
I'm trying to open a specific link in google chrome

i tried this (with no luck)

B4X:
    Dim pi As Intent
    'Dim pm As PackageManager
     pi.Initialize(pi.ACTION_VIEW,"http://google.com")
      pi.SetComponent("com.android.browser/.BrowserActivity")
      pi.SetType("text/html")
    StartActivity(pi)



i found this , but i couldnt convert it to B4A
B4X:
String urlString="http://mysuperwebsite";
Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("com.android.chrome");
try {
    context.startActivity(intent);
} catch (ActivityNotFoundException ex) {
    // Chrome browser presumably not installed so allow user to choose instead
    intent.setPackage(null);
    context.startActivity(intent);
}


any ideas ?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…