Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.