Last active
August 29, 2015 13:56
-
-
Save Hulzenga/9003147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int popupStack = 0; | |
private boolean showingPopup = false; | |
public void showPopup() { | |
if (!showingPopup) { | |
showingPopup = true; | |
//if this isn't popup number 0 one should be eliminated from the stack | |
if (popupStack > 0) { | |
popupStack--; | |
} | |
final Dialog dialog = new Dialog(this) { | |
@Override | |
protected void onStop() { | |
super.onStop(); | |
showingPopup = false; | |
if (popupStack > 0) { | |
showPopup(); | |
} | |
} | |
}; | |
dialog.setContentView(R.layout.pop_up); | |
dialog.setTitle("Not enough points"); | |
dialog.show(); | |
z = 1; | |
Button btnCancel = (Button) dialog.findViewById(R.id.cancel); | |
btnCancel.setOnClickListener(new View.OnClickListener() { | |
public void onClick(View v) { | |
dialog.dismiss(); | |
} | |
}); | |
} else { | |
popupStack++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment