Open Chrome App with URL

后端 未结 8 1454
情话喂你
情话喂你 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:19

    Your xml:

    
    
    

    Your WebViewActivity:

    public class WebViewActivity extends Activity {
    
        private WebView webView;
    
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.webview);
    
            webView = (WebView) findViewById(R.id.webView1);
            webView.getSettings().setJavaScriptEnabled(true);
            webView.loadUrl("http://www.google.com");
        }
    }
    

提交回复
热议问题