How about you show the dialog *before* you start the activity? On Mon, Feb 16, 2009 at 2:10 PM, Evgeny V <evgen...@gmail.com> wrote: > Any suggestions on it? > > Thanks, > Evgeny > > On Sat, Feb 14, 2009 at 1:31 AM, EvgenyV <evgen...@gmail.com> wrote: >> >> Hi! >> I'm trying to show dialog OK/Cancel and then continue construction >> after user closed the dialog. >> Unfortunately the dialog get visibility only AFTER the creation of >> myclass was completed. >> In my example Run( ) method will never run. >> >> There is code: >> >> public class MyClass extends Activity >> { >> private _boolFlag = false; >> >> @Override >> public void onCreate(Bundle savedInstanceState) { >> try { >> >> super.onCreate(savedInstanceState); >> ....some code... >> showDialog(Dialog.BUTTON2); >> if(_boolFlag) >> Run().// never run >> } >> } >> >> >> @Override >> protected Dialog onCreateDialog(int id) >> { >> switch (id) >> { >> case Dialog.BUTTON2: >> return new AlertDialog.Builder(this) >> .setIcon(R.drawable.files_down_32) >> .setTitle("title") >> .setPositiveButton("Ok", new >> DialogInterface.OnClickListener() { >> public void onClick(DialogInterface dialog, int >> whichButton) { >> _boolFlag = true; >> } >> }).create(); >> } >> return null; >> } >> >> private void Run() >> { >> >> } >> >> } >> >> What can I do except to move the dialog to the caller activity? >> >> Thanks in advance, >> Evgeny >> >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---