Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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
Android 如何将呼叫按钮更改为链接按钮_Android - Fatal编程技术网

Android 如何将呼叫按钮更改为链接按钮

Android 如何将呼叫按钮更改为链接按钮,android,Android,我只是个android新手, 如何将呼叫按钮更改为twitter/facebook或链接网站的链接按钮 // ------------ Call button--------------------- private void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setDa

我只是个android新手, 如何将呼叫按钮更改为twitter/facebook或链接网站的链接按钮

 // ------------ Call button---------------------
        private void call() {
            try {
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:"+Info.phoneNumber+""));
                startActivity(callIntent);
            } catch (ActivityNotFoundException activityException) {

            }
        }

        public void btnPhone(View v) {

            try {

                call();

            } catch (Exception e) {
                // TODO: handle exception
            }

        }
主要


你需要像这样更新

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);
public static String phoneNumber = "+xxxxxx";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);