Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.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 使用DialogFragment的Web链接_Java_Android_Eclipse_Onclick_Fragmentmanager - Fatal编程技术网

Java 使用DialogFragment的Web链接

Java 使用DialogFragment的Web链接,java,android,eclipse,onclick,fragmentmanager,Java,Android,Eclipse,Onclick,Fragmentmanager,我有这个对话框片段,但我正在尝试获取它,这样当用户单击“我的其他应用”按钮时,他们会被重定向到一个网址。有没有办法做到这一点。 谢谢你的帮助 谢谢 在按钮上执行此操作,然后单击: @Override public void onClick(DialogInterface dialog, int which) { String url = "http://www.example.com"; Intent i = new Intent(Intent.ACTION_VIEW);

我有这个对话框片段,但我正在尝试获取它,这样当用户单击“我的其他应用”按钮时,他们会被重定向到一个网址。有没有办法做到这一点。 谢谢你的帮助 谢谢


在按钮上执行此操作,然后单击:

 @Override
 public void onClick(DialogInterface dialog, int which) {
     String url = "http://www.example.com";
     Intent i = new Intent(Intent.ACTION_VIEW);
     i.setData(Uri.parse(url));
     startActivity(i);

 }

发帖前做一点调查please@njzk2对不起,谢谢!
 @Override
 public void onClick(DialogInterface dialog, int which) {
     String url = "http://www.example.com";
     Intent i = new Intent(Intent.ACTION_VIEW);
     i.setData(Uri.parse(url));
     startActivity(i);

 }
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// TODO Auto-generated method stub

AlertDialog.Builder theDialog = new AlertDialog.Builder(getActivity());
theDialog.setTitle("About");
String d1 = "Thanks For Downloading! ";
String d2 = "Made by ME";
theDialog.setMessage(d1 +"\n"+ d2 ); 
theDialog.setPositiveButton("My Other Apps", new DialogInterface.OnClickListener(){


@Override
public void onClick(DialogInterface dialog, int which) {
    String url = "http://www.example.com";
    Intent i = new Intent(Intent.ACTION_VIEW);
    i.setData(Uri.parse(url));
    startActivity(i);

}

});

theDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener(){

@Override
public void onClick(DialogInterface dialog, int which) {
    Toast.makeText(getActivity(), "Clicked Cancel",
    Toast.LENGTH_SHORT).show();

}

});     
return theDialog.create();
}
}