Bad window token, you cannot show a dialog before an Activity is created or after it's hidden
问题 I am using an AppIntro library in my app. It has 3 slides. I want to ask the user something when the third slide is shown. To achieve that I am using material dialogs by afollestad. My code in the AppIntro Activity looks like that: @Override public void onNextPressed() { if(this.pager.getCurrentItem() == 2) { MaterialDialog dialog = new MaterialDialog.Builder(getApplicationContext()) .title("QR Code scannen") .content("Möchtest du den QR Code scannen oder selbst eingeben?") .positiveText(