I have an application where I have an error dialog pop-up. If i do not touch the screen letting the screen dim off, and then turn the screen on,the pop up dialog is no more there. I want the dialog to be there even if the backlight is turned after it goes off, like in other normal android dialogs.
This is how I am creating the dialog
Dialog lVoiceDialog=new AlertDialog.Builder(this).setIcon(
R.drawable.ic_dialog_alert).setMessage(mVoiceCallMessage)
.setPositiveButton(R.string.yes, clickListener)
.setNegativeButton(R.string.no,clickListener1).create();
lVoiceDialog.setOnDismissListener(dismissListener);
where clickListener and clickListener1 are individual listeners for the positive and negative buttons respectively and dismissListener is listener for running code when the dialog is about to be dismissed.
Please
The other answers make me think I misunderstood the question but just in case..
Your activity is (possibly) being closed when the screen goes off. and restarted when it returns in the normal android activity lifecycle.
To retain your dialog, you would need to save its state when the activity closes and reshow it when it returns.
You can demonstrate this by showing the dialog and rotating the phone. Switching orientation does pretty much the same thing.