[android-developers] Re: Show dialog on creation - question?
Hi Dianne! Thanks you for response! Can you suggest how can I implement so simple scenario: -Activity started - the user already got the screen. -Immediately after activity UI dispalyed I need to start update process indicated by progress dialog I tried to impelement onPrepareDialog, onStart, and onPostCreated. Both happens before the actually activity displayed and as result the progress dialog is invisilible. I need something like onAfterActivityDisplayed( ) Event which happenning after onCreateDialog( ). Thanks, Evgeny On Wed, Feb 18, 2009 at 1:26 AM, Dianne Hackborn hack...@android.comwrote: Dialogs are not blocking. You can't stop things from continuing execution while displaying the dialog. On Fri, Feb 13, 2009 at 3:31 PM, 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Show dialog on creation - question?
Yes, I know. I actually did it and don't like it. What about incapsulation? I mean in this case parent class will keep and analize some specifed info about its child. Thanks, Evgeny On Mon, Feb 16, 2009 at 3:18 PM, Stoyan Damov stoyan.da...@gmail.comwrote: 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 -~--~~~~--~~--~--~---
[android-developers] Re: Show dialog on creation - question?
Dialogs are not blocking. You can't stop things from continuing execution while displaying the dialog. On Fri, Feb 13, 2009 at 3:31 PM, 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[android-developers] Re: Show dialog on creation - question?
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 -~--~~~~--~~--~--~---
[android-developers] Re: Show dialog on creation - question?
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 -~--~~~~--~~--~--~---