How To Start An Activity From An Alertdialog?
I created an AlertDialog : public class ConfirmChoixDownloadDialogView extends AlertDialog { private Activity activity; // this activity shows this Dialog private View co
Solution 1:
showDialog(this, "", newDialogInterface.OnClickListener() {
@OverridepublicvoidonClick(DialogInterface dialog, int which) {
Intenti=newIntent(getApplicationContext(), NextActivty.class);
startActivity(i);
finish();
}
});
Solution 2:
In your case maybe try using the context of the AlertDialog instead of the Activity calling it like this:
context.startActivity(i);
instead of activity.startActivity(i)
Post a Comment for "How To Start An Activity From An Alertdialog?"