If your app crash with this error:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
.. while while it tries to display dialog ,then it mean you provide wrong contextSOLUTION
replace:
AlertDialog.Builder alertBox = new AlertDialog.Builder(getApplicationContext());
with
AlertDialog.Builder alertBox = new AlertDialog.Builder(AppLauncher.this);
No comments:
Post a Comment