Open Chrome App with URL

后端 未结 8 1471
情话喂你
情话喂你 2021-02-02 14:59

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:

<
8条回答
  •  爱一瞬间的悲伤
    2021-02-02 15:34

    I opened my Safe Browser App with getting package name from Google play, the same way you can open for chrome by default also:

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("http://Your URL"));
    intent.setPackage("com.cloudacl");  // package of SafeBrowser App 
    startActivity(intent);
    

    You can replace package com.cloudacl with this com.android.chrome to open chrome.

提交回复
热议问题