Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/224.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WebView android(开放浏览器)_Android_Webview_Android Webview - Fatal编程技术网

WebView android(开放浏览器)

WebView android(开放浏览器),android,webview,android-webview,Android,Webview,Android Webview,单击按钮时,我需要在浏览器中打开WebView当前URL 现在有了这个代码: WebView webview; private WebView mWebView; /** * Dichiariamo l'attributo di classe url in cui * salviamo l'indirizzo web che aprir¬à la webview */ private String url = "http://www.google.com"; 需要在浏览器中打

单击按钮时,我需要在浏览器中打开WebView当前URL

现在有了这个代码:

 WebView webview;
private WebView mWebView;
/**
  * Dichiariamo l'attributo di classe url in cui  
  * salviamo l'indirizzo web che aprirˆ la webview
  */
private String url = "http://www.google.com";
需要在浏览器中打开当前url webview的代码

谢谢你试试这个

String url = "http://www.google.com";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
试试这个

String url = "http://www.google.com";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
试试这个

String url = "http://www.google.com";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
试试这个

String url = "http://www.google.com";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);

您可以创建
mWebView
类型的
WebView
实例字段,然后从
xml
将其分配给您的WebView id,如下所示

WebView mWebView = (WebView) findViewById(R.id.webView1);
然后使用
loadUrl
方法加载url

        webView.loadUrl("your URL here");   
如果要在单击按钮时在浏览器中加载此url

        Button button1;
        button1 = (Button) findViewById(R.id.myButton);
        button1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("your URL"));
                startActivity(browserIntent);

            }
        });

您可以创建
mWebView
类型的
WebView
实例字段,然后从
xml
将其分配给您的WebView id,如下所示

WebView mWebView = (WebView) findViewById(R.id.webView1);
然后使用
loadUrl
方法加载url

        webView.loadUrl("your URL here");   
如果要在单击按钮时在浏览器中加载此url

        Button button1;
        button1 = (Button) findViewById(R.id.myButton);
        button1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("your URL"));
                startActivity(browserIntent);

            }
        });

您可以创建
mWebView
类型的
WebView
实例字段,然后从
xml
将其分配给您的WebView id,如下所示

WebView mWebView = (WebView) findViewById(R.id.webView1);
然后使用
loadUrl
方法加载url

        webView.loadUrl("your URL here");   
如果要在单击按钮时在浏览器中加载此url

        Button button1;
        button1 = (Button) findViewById(R.id.myButton);
        button1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("your URL"));
                startActivity(browserIntent);

            }
        });

您可以创建
mWebView
类型的
WebView
实例字段,然后从
xml
将其分配给您的WebView id,如下所示

WebView mWebView = (WebView) findViewById(R.id.webView1);
然后使用
loadUrl
方法加载url

        webView.loadUrl("your URL here");   
如果要在单击按钮时在浏览器中加载此url

        Button button1;
        button1 = (Button) findViewById(R.id.myButton);
        button1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("your URL"));
                startActivity(browserIntent);

            }
        });

您想在webview或浏览器中加载url吗?您想在webview或浏览器中加载url吗?您想在webview或浏览器中加载url吗?您想在webview或浏览器中加载url吗?我需要点击按钮1我需要点击按钮1我需要点击按钮1我需要点击按钮1我需要点击按钮1我需要点击按钮1我需要点击按钮1我需要点击按钮1我需要当前url什么意思当前url?我需要当前url你是什么意思当前url?我需要当前url你是什么意思当前url?我需要当前url你是什么意思当前url?