Waiting for DialogActivity to return before continuing executing of the main thread
- by jax
How would I force the current thread to wait until another has finished before continuing.
In my program the user selects a MODE from an AlertDialog, I want to halt executing of the program before continuing as the mode holds important configuration for the gameplay.
new AlertDialog.Builder(this)
.setItems(R.array.game_modes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case 0:
setMode(TRAINING_MODE);
case 1:
setMode(QUIZ_MODE);
default:
setMode(TRAINING_MODE);
break;
}
//continue loading the rest of onCreate();
contineOnCreate();
}
})
.create().show();
If this is impossible can anyone give a possible solution?