Show an AlertDialog box that can not be cancelled (by pressing the back button). Dismiss this dialog when your task has completed.
The AlertDialog, if it can not be cancelled, will prevent the back- button from going back to the previous activity. Be absolutely sure that the task finishes properly and the AlertDialog is being dismissed in reasonable amount of time. If not, your users are going to be pissed off for waiting a long time. Also, the user can still exit your app by pressing the Home key. On May 13, 10:15 am, dillipk <codersnet2...@gmail.com> wrote: > Hi, > The default behavior of an activity when BACK softkey is pressed is, > GO BACK TO PREVIOUS ACTIVITY.. > > If some the same activity is waiting for some response from server or > some data updation is going on and then press BACK, I want to wait on > the same screen till the current task is completely processed and then > move out to the previous activity. > > I would appreciate if someone can send me some sample code or way to > do.. > > Thanks, > > Regards, > DK > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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