public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle("Publisher"); final String[] items={"Success","Failure"}; builder.setItems(items, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which){ case 0: //success break; case 1: //failure break; } } }); return builder.create();
但是运行这个后不显示内容