Re: [android-developers] Re: how to use AsyncTask

2012-02-01 Thread Farhan Tariq
One consideration though, if i am not wrong, AsyncTasks need to be executed from the UIThread. Regarding your code, put the part in which the HTTP Request is sent and the response is got in "line" in the "doInBackground" method of the AsyncTask so that it runs on the background thread and does not

[android-developers] Re: how to use AsyncTask

2012-02-01 Thread madlymad
here is a good example of Asynctask usage! http://www.androidsnippets.com/grab-a-url-source-with-progressdialog-and-asynctask On Jan 31, 3:24 pm, aashutosh wrote: > Hello, > > How can i use Asynctask for the following code: > > public static String getXML()  { > >                         String

[android-developers] Re: How to use AsyncTask from a Thread?

2009-07-29 Thread Romain Guy
Just start another thread :) AsyncTask is tied to the UI thread, if you already have your own thread, you cannot use AsyncTask. On Wed, Jul 29, 2009 at 9:16 AM, f_heft wrote: > > Hello, > > I'm developing a game based on SurfaceView and a game thread for the > whole game thing (calculating/drawin