Is there a way to open Chrome app on Android from default Android browser? I\'m able to open the app, but it doesn\'t redirect user to correct page. This is what I tried:
<
Here is a solution without a try catch,
if chrome is installed, it will be used. Otherwise, it will go to the device default
void open(Activity activity, String url) {
Uri uri = Uri.parse("googlechrome://navigate?url=" + url);
Intent i = new Intent(Intent.ACTION_VIEW, uri);
if (i.resolveActivity(activity.getPackageManager()) == null) {
i.setData(Uri.parse(url));
}
activity.startActivity(i);
}