Android Dialog - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Dialog class.

This code example shows how to use the following methods:setCancelable, setMessage, setProgress, setProgressStyle
    } 
   
     @Override 
     protected void onProgressUpdate(Integer... args){
       if (progressDialog == null) {
         progressDialog = new ProgressDialog(context);
         progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
         progressDialog.setMessage("Loading...");
         progressDialog.setCancelable(false);
         progressDialog.show();
       } 
       progressDialog.setProgress(args[0]);
     } 
      
     @Override 
     protected void onPostExecute(Boolean result) {
       if (progressDialog != null) {
         progressDialog.dismiss();
       } 
        
9
CodeRank
This code example shows how to use the following methods:dismiss
		LOG.d("WaitingDialog", "Dialog shown, waiting hide command"); 
	} 
	 
	public void hideWaitingDialog() { 
		if (waitingDialog != null) {
			waitingDialog.dismiss();
			LOG.d("WaitingDialog", "Dialog dismissed"); 
			waitingDialog = null;
		} else { 
			LOG.d("WaitingDialog", "Nothing to dismiss"); 
		} 
	} 
	 
} 
9
CodeRank
This code example shows how to use the following methods:setCancelable, setOnCancelListener, show, setIndeterminate, setMessage
9
CodeRank
This code example shows how to use the following methods:setButton, setMessage, setTitle, dismiss, isShowing
            dialog = new AlertDialog.Builder(context)
                    .setPositiveButton(android.R.string.ok, disconnectListener)
                    .setNegativeButton(android.R.string.cancel, null)
                    .create();
        } else { 
            if (dialog.isShowing()) {
                dialog.dismiss();
            } 
            // use disconnectListener for the correct profile(s) 
            CharSequence okText = context.getText(android.R.string.ok);
            dialog.setButton(DialogInterface.BUTTON_POSITIVE,
                    okText, disconnectListener);
        } 
        dialog.setTitle(title);
        dialog.setMessage(message);
        dialog.show();
        return dialog;
    } 
 
    // TODO: wire this up to show connection errors... 
    static void showConnectingError(Context context, String name) {
9
CodeRank
This code example shows how to use the following methods:setOnKeyListener, setTitle, setIndeterminate, setMessage
8
CodeRank
This code example shows how to use the following methods:setTitle, setCancelable, setOnCancelListener, show, setIndeterminate
This code example shows how to use the following methods:show, setIndeterminate, setMessage
		this.showProgressDialog("Loading. Please wait...");
	} 
 
	public void showProgressDialog(CharSequence message) {
		if (this.progressDialog == null) {
			this.progressDialog = new ProgressDialog(this);
			this.progressDialog.setIndeterminate(true);
		} 
 
		this.progressDialog.setMessage(message);
		this.progressDialog.show();
	} 
 
	public void dismissProgressDialog() { 
		if (this.progressDialog != null && !this.destroyed) {
			this.progressDialog.dismiss();
		} 
	} 
 
} 
8
CodeRank
This code example shows how to use the following methods:setCancelable, setIndeterminate, setMessage
		mMessage = message;
	} 
 
	@Override 
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		final ProgressDialog dialog = new ProgressDialog(getActivity());
	     
	    dialog.setMessage(mMessage);
	    dialog.setIndeterminate(true);
	    dialog.setCancelable(false);
	     
	     
	    return dialog;
	} 
	 
	public static void showLoadingProgress(FragmentManager fragman) {
		dismissLoadingProgress(fragman);
		ProgressDialogFragment loading = new ProgressDialogFragment("Loading...");
		loading.show(fragman, "loading");
	} 
7
CodeRank
This code example shows how to use the following methods:dismiss, getOwnerActivity
This code example shows how to use the following methods:
        assertThat(shadow).isInstanceOf(ShadowPreferenceGroup.class);
	} 
	 
	@Test 
	public void shouldSetDialog() { 
		Dialog dialog = new Dialog(new Activity());
 
        assertThat(screen.getDialog()).isNull();
		shadow.setDialog(dialog);
        assertThat(screen.getDialog()).isSameAs(dialog);
	} 
} 
7
CodeRank

Related Android Dialog Questions & Answers:

Other Android Dialog Examples

59:		@Override
60:		protected Dialog onCreateDialog(int id) {
61:			switch (id) {
62:			case progress_bar_type: // we set this to 0
63:				pDialog = new ProgressDialog(this);

Read More

3:	
4:	    @Override
5:	    public Dialog onCreateDialog(Bundle savedInstanceState) {
6:	        // Use the current date as the default date in the picker
7:	        final Calendar c = Calendar.getInstance();

Read More

3:	
4:	    @Override
5:	    public Dialog onCreateDialog(Bundle savedInstanceState) {
6:	        // Use the current time as the default values for the picker
7:	        final Calendar c = Calendar.getInstance();

Read More

See Code Examples for Android Dialog Methods: