tags:

views:

78

answers:

2

I have an IntentService that downloads some files. The problem is that I create a Toast inside the IntentService like this

Toast.makeText(getApplicationContext(), "some message", Toast.LENGTH_SHORT).show();

The Toast will never disappear event if I exit the app. The only way to destroy it is to kill the process.

What am I doing wrong?

A: 

You shouldn't create Toasts from a Service. You should use a Notification instead.

Qberticus
A: 

There's no reason not to create a Toast from a service.

From the notification dev guide:

If you create a toast notification from a Service, it appears in front of the Activity currently in focus.

Pierre-Luc Paour