¿Cómo actualizo mi interfaz de usuario principal desde el servicio y aún puedo mover la barra de búsqueda?

im really out of idea and im just a beginner in android development, how do I update my ImageView from the service and still able to move around the seekbar.

what my current code now do is that when I pressed the play button my acitvity starts my service and download the image from my server like http://www.domain.com/images/filename.jpg once downloaded it changes y imageview to that file that has been downloaded the problem is that while it is downloading my main UI is not responding, its like its on pause or something like that and after the download is finished my ui respond to me.. any ideas ??

preguntado el 01 de febrero de 12 a las 13:02

2 Respuestas

You can use AsynchTask to download the image from server. It provides you methods to specify what you want to do in background, before and after the task. Check Android Developer note. Also see example from vogella's site

Respondido 01 Feb 12, 18:02

Your application isn't responding because you are hijacking the UI thread. Instead of updating the UI and responding to user input, it's working on this image download.

Intenta usar AsyncTask. It was designed to allow you to run operations in the background and still update the UI thread.

It can also notify the UI thread as progress is made on the task.

Respondido 01 Feb 12, 18:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.