Handler location for asynchronous operations?

Put your problem here if it does not fit any of the other categories.

Handler location for asynchronous operations?

Postby ParanoidAndroid » Wed Apr 08, 2009 9:51 am

I use handlers to display Toasts. These handler must be inside of an Activity, right?

Now I wonder what happens when I want to show that toast with a certain delay due to an asynchronous operation. E.g. I retrieve some details from a server and want to notify the user of the result. The activity could have been destroyed in the meantime and my toast cannot be displayed.
I could maybe use Notifications but I really do want to use toasts.

Is there any workaround? Do I need to keep at least one activity alive which the user must not close? However, the OS could still finish that activity.
ParanoidAndroid
Freshman
Freshman
 
Posts: 6
Joined: Fri Mar 20, 2009 2:46 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 25 guests