Skip to content

Instantly share code, notes, and snippets.

@CrandellWS
Created May 29, 2016 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CrandellWS/ac79d3864a96344d204d869d64fd1922 to your computer and use it in GitHub Desktop.
Save CrandellWS/ac79d3864a96344d204d869d64fd1922 to your computer and use it in GitHub Desktop.
Alert Dialog Cancel Activity to send onResume event.
import android.app.Activity;
import android.os.Bundle;
/**
* Created by William on 5/29/2016.
*
* new AlertDialog.Builder(this).
*
* use:(OnClickListener){setNegativeButton, setNeutralButton, setPositiveButton}
*
* new DialogInterface.OnClickListener() {
* @Override
* public void onClick(DialogInterface dialog, int which) {
* Intent starterIntent = new Intent(getApplicationContext(), DismissCancelDialogActivity.class);
* startActivity(starterIntent, null);
* }
* }
*
* ---- OR ----
*
* new AlertDialog.Builder(this).
* setOnDismissListener(new OnDismissListener() {
* @Override
* public void onDismiss(final DialogInterface arg0) {
* Intent starterIntent = new Intent(getApplicationContext(), DismissCancelDialogActivity.class);
* startActivity(starterIntent, null);
* }
* });
*
*/
public class DismissCancelDialogActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
finish();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment