List of usage examples for android.app Dialog Dialog
public Dialog(@NonNull Context context)
From source file:com.amazon.appstream.sampleclient.ErrorDialogFragment.java
/** * Standard initialization. Sets up the dialog to quit the * activity on clicking its only button. *//*w w w .jav a2 s. c o m*/ @Override public Dialog onCreateDialog(Bundle savedInstanceState) { final Dialog dialog = new Dialog(getActivity()); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCanceledOnTouchOutside(false); dialog.setCancelable(false); dialog.getWindow().setBackgroundDrawable(ConnectDialogFragment.mEmpty); dialog.setContentView(R.layout.fatal_error); final Button signin = (Button) dialog.findViewById(R.id.signin); final TextView message = (TextView) dialog.findViewById(R.id.message); message.setText(mMessage); signin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); ((SampleClientActivity) getActivity()).openConnectDialog(null); } }); return dialog; }
From source file:bijznas.notify.crouton.ShowInfo.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { dialog = new Dialog(getActivity()); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); dialog.setContentView(R.layout.show_info); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); context = getActivity();/*from w w w. j ava 2 s . c o m*/ manager = getActivity().getSupportFragmentManager(); lv = (ListView) dialog.findViewById(R.id.lVDetails); topdf = (TextView) dialog.findViewById(R.id.topdf); photo = (ImageView) dialog.findViewById(R.id.imageView3); MyCustomAdapter adapterCustom = new MyCustomAdapter(context, caption, information); lv.setAdapter(adapterCustom); ok = (Button) dialog.findViewById(R.id.btnOkSUP); ok.setOnClickListener(this); topdf.setText(info + " Found"); // read(); // Message.message(getActivity(), alContacts.get(0)); dialog.show(); return dialog; }
From source file:com.pileproject.drive.setting.machine.NxtFirmwareFragment.java
@Override @NonNull// ww w.ja v a 2 s . c o m public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = new Dialog(getActivity()); dialog.setTitle(R.string.setting_firmware); return dialog; }
From source file:com.pileproject.drive.setting.machine.NxtPortConnectionFragment.java
@Override @NonNull/*from w ww .j av a2 s . c o m*/ public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = new Dialog(getActivity()); dialog.setTitle(R.string.setting_portConnection); return dialog; }
From source file:ca.cmput301w14t09.PopUpEdit.java
/** * Creates a popup edit window with the given input parameters. * @param comment - edited comment.//w ww. j a va2s . co m */ public void popUpEdit(final Comment comment) { //Creates a dialog box final Dialog dialog = new Dialog(caller); dialog.setContentView(R.layout.pop_up_edit); dialog.setTitle("Comment Text"); Button Submit = (Button) dialog.findViewById(R.id.Submit); final EditText commentText = (EditText) dialog.findViewById(R.id.editComment); commentText.setHint(comment.getCommentText()); dialog.show(); Submit.setOnClickListener(new View.OnClickListener() { //when submit is pressed everything is pused to the server @Override public void onClick(View v) { String str = "commentText = \\\"" + commentText.getText() + "\\\"\""; if (Server.getInstance().isServerReachable(caller)) { try { ElasticSearchOperations.updateComment(comment, str); } catch (InterruptedException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } dialog.dismiss(); } }); }
From source file:com.veniosg.dir.android.dialog.SingleDeleteDialog.java
@NonNull @Override//from w w w. j av a 2 s. c om public Dialog onCreateDialog(Bundle savedInstanceState) { FileHolder holder = getArguments().getParcelable(EXTRA_DIALOG_FILE_HOLDER); if (holder != null) { AlertDialog dialog = new AlertDialog.Builder(getActivity()) .setTitle(getString(R.string.really_delete, holder.getName())) .setPositiveButton(R.string.yes, (dialog1, which) -> { new DeleteAsyncTask(getContext()).execute(holder); }).setNegativeButton(R.string.no, null).create(); dialog.setIcon(R.drawable.ic_dialog_delete); return dialog; } else { dismiss(); return new Dialog(getContext()); } }
From source file:com.veniosg.dir.android.dialog.MultiDeleteDialog.java
@NonNull @Override//from ww w . j a va2 s .co m public Dialog onCreateDialog(Bundle savedInstanceState) { ArrayList<FileHolder> holders = getArguments().getParcelableArrayList(EXTRA_DIALOG_FILE_HOLDER); if (holders != null) { AlertDialog dialog = new AlertDialog.Builder(getActivity()) .setTitle(getString(R.string.really_delete_multiselect, holders.size())) .setPositiveButton(R.string.yes, (dialog1, which) -> { FileHolder[] params = holders.toArray(new FileHolder[holders.size()]); new DeleteAsyncTask(getContext()).execute(params); }).setNegativeButton(R.string.no, null).create(); dialog.setIcon(R.drawable.ic_dialog_delete); return dialog; } else { dismiss(); return new Dialog(getContext()); } }
From source file:com.digitallizard.nicecompass.CompassActivity.java
private Dialog createSelectBearingDialog() { Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.bearing_dialog); EditText bearingText = (EditText) dialog.findViewById(R.id.bearingSelectionText); bearingText.setText(""); // set the initial text bearingText.requestFocus(); // get the focus return dialog; }
From source file:com.pileproject.drive.setting.machine.NxtThresholdFragment.java
@Override @NonNull/*from w ww.j av a 2s . c o m*/ public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = new Dialog(getActivity()); dialog.setTitle(R.string.setting_threshold); return dialog; }
From source file:com.privacity.MainActivity.java
public void actualizarValidador(String verificador) { if (com.obtenerAccessToken(verificador)) { Intent intent = new Intent(this, MenuActivity.class); startActivity(intent);/*from w w w . ja v a 2s. com*/ this.finish(); } else { Dialog dialogoError = new Dialog(this); dialogoError.setTitle(R.string.VerificadorIncorrecto); dialogoError.show(); } }