Dialog.setOnDismissListener
Code IndexAdd Codota to your IDE (free)

Best code snippets using android.app.Dialog.setOnDismissListener(Showing top 5 results out of 315)

origin: stackoverflow.com

Preference myPrefScreen = findPreference("myPrefScreen");
 myPrefScreen 
     .setOnPreferenceClickListener(new OnPreferenceClickListener() {
       @Override
       public boolean onPreferenceClick(Preference prefScreen) {
         // TODO Auto-generated method stub
         Dialog prefScreenDialog = ((PreferenceScreen) prefScreen)
             .getDialog();
         prefScreenDialog
             .setOnDismissListener(new OnDismissListener() {
               @Override
               public void onDismiss(DialogInterface arg0) {
                 // TODO Auto-generated method stub
                 ///HERE YOU CAN EXECUTE WHATEVER YOU WANT... 
               }
             });
         return false;
       }
     });
origin: stackoverflow.com

 @Override
  protected Dialog onCreateDialog(int id) {
  super.onCreateDialog(id);
  final Dialog dialog = new Dialog(UserStatsActivity.this);
  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  dialog.setContentView(R.layout.createuserrow);
  dialog.setOnDismissListener(this);

  //set up button
  Button button = (Button) dialog.findViewById(R.id.saveUser);
  button.setOnClickListener(new View.OnClickListener() {

    public void onClick(View v) {
      TextView nameTextView = (TextView)dialog.findViewById(R.id.userName);
      userNickName = nameTextView.getText().toString().trim();

      if ((userNickName.length() > 0) && (userNickName.length() < 9)){
        saveUser = true;
        dialog.dismiss();
      }
    }
  });
//now that the dialog is set up, it's time to show it
return dialog;
}
origin: com.google.android/support-v4

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  if (!mShowsDialog) {
    return;
  }
  View view = getView();
  if (view != null) {
    if (view.getParent() != null) {
      throw new IllegalStateException("DialogFragment can not be attached to a container view");
    }
    mDialog.setContentView(view);
  }
  mDialog.setOwnerActivity(getActivity());
  mDialog.setCancelable(mCancelable);
  mDialog.setOnCancelListener(this);
  mDialog.setOnDismissListener(this);
  if (savedInstanceState != null) {
    Bundle dialogState = savedInstanceState.getBundle(SAVED_DIALOG_STATE_TAG);
    if (dialogState != null) {
      mDialog.onRestoreInstanceState(dialogState);
    }
  }
}
origin: stackoverflow.com

case DURATION_DIALOG:
  dialog = new DurationDialog(Activity.this, "your title", "your body");
  dialog.setOnDismissListener(onDismissListener);
  break;
default:
origin: android.support/compatibility-v4

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  if (!mShowsDialog) {
    return;
  }
  View view = getView();
  if (view != null) {
    if (view.getParent() != null) {
      throw new IllegalStateException("DialogFragment can not be attached to a container view");
    }
    mDialog.setContentView(view);
  }
  mDialog.setOwnerActivity(getActivity());
  mDialog.setCancelable(mCancelable);
  mDialog.setOnCancelListener(this);
  mDialog.setOnDismissListener(this);
  if (savedInstanceState != null) {
    Bundle dialogState = savedInstanceState.getBundle(SAVED_DIALOG_STATE_TAG);
    if (dialogState != null) {
      mDialog.onRestoreInstanceState(dialogState);
    }
  }
}
android.appDialogsetOnDismissListener

Popular methods of Dialog

  • dismiss
  • getContext
  • getWindow
  • show
  • setContentView
  • <init>
  • setOnCancelListener
  • findViewById
  • onSaveInstanceState
  • requestWindowFeature
  • setCancelable
  • setCanceledOnTouchOutside
  • setCancelable,
  • setCanceledOnTouchOutside,
  • hide,
  • onRestoreInstanceState,
  • setOwnerActivity,
  • cancel,
  • dispatchOnCreate,
  • getActionBar,
  • isShowing

Popular classes and methods

  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResultSet (java.sql)
    A table of data representing a database result set, which is usually generated by executing a statem
  • SortedMap (java.util)
    A Map that further provides a total ordering on its keys. The map is ordered according to the Compar
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • TreeMap (java.util)
    A map whose entries are sorted by their keys. All optional operations such as #put and #remove are s
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)