Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/326.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
Java 偏好:OnClick指向社交网络_Java_Android - Fatal编程技术网

Java 偏好:OnClick指向社交网络

Java 偏好:OnClick指向社交网络,java,android,Java,Android,我创建了一个偏好活动,在这里我对社交网络(Facebook、Twitter、Google+)有各种偏好,我想点击这些偏好你可能会被引导到相应的页面,我怎么能 它将打开具有给定URL的浏览器: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com")); startActivity(browserIntent); 如果要打开应用程序,请尝试以下操作: Intent inte

我创建了一个偏好活动,在这里我对社交网络(Facebook、Twitter、Google+)有各种偏好,我想点击这些偏好你可能会被引导到相应的页面,我怎么能

它将打开具有给定URL的浏览器:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com"));
startActivity(browserIntent);
如果要打开应用程序,请尝试以下操作:

Intent intent = new Intent("android.intent.category.LAUNCHER");
intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");
startActivity(intent);

它将打开具有给定URL的浏览器:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com"));
startActivity(browserIntent);
如果要打开应用程序,请尝试以下操作:

Intent intent = new Intent("android.intent.category.LAUNCHER");
intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");
startActivity(intent);

如果我想打开facebook应用程序?如果我想让用户选择是打开浏览器还是facebook应用程序?创建一个带有2个按钮的对话框,其中一个按钮将打开网站,其他应用程序。如果我想打开facebook应用程序?如果我想让用户选择是否打开浏览器或facebook应用程序?创建一个带有2个按钮的对话框,其中一个按钮将打开网站,另一个应用程序。