Why wait until the person wants to leave? Submit the data and if there is a
change, submit an update. That way when the user wants to leave, they just
leave. Behind the scenes a service takes care of sending the information.
You are blocking the user interface with code that should be in the service.

On Thu, May 13, 2010 at 3:13 PM, dillipk <[email protected]> wrote:

> Thanks TreKing for your replies..
>
>  Basically my requirement is,  as soon as you try to leave out of the
> screen(Whether by hitting BACK key), it makes a HTTP request (by
> sending some data from the current screen)  to get some data from the
> server and once it receives the response from the server, it can leave
> out.
>
>
>
> On May 13, 1:45 pm, TreKing <[email protected]> wrote:
> > On Thu, May 13, 2010 at 11:24 AM, dillipk <[email protected]>
> wrote:
> > > Is there any api which would wait there on the activity/screen till
> there
> > > is a response from a server or the task is complete instead of
> displaying
> > > ProgressDialog etc,,?
> >
> > Your question doesn't really make sense. An API is not something that
> "would
> > wait". You should add a little more detail as to what you're really
> trying
> > to do here.
> >
> > Obviously you're not required to use a progress dialog - you could have a
> > static message you show at first and update after the response, or
> > something. But in this case the user can back out at any time (which is
> > good), in which case you would want to cancel your ongoing task.
> >
> > I guess you COULD handle the back key press and prevent this, like the
> > dialog scenario, but again, my previous comments apply.
> >
> >
> -------------------------------------------------------------------------------------------------
> > TreKing - Chicago transit tracking app for Android-powered deviceshttp://
> sites.google.com/site/rezmobileapps/treking
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Robert Casto
www.IWantFreeShipping.com
Find Amazon Filler Items easily!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to