protected abstract Result *doInBackground* (Params... params)
Added in API level 3
Override this method to perform a computation on a *background thread*. The 
specified parameters are the parameters passed toexecute(Params...) by the 
caller of this task. This method can call publishProgress(Progress...) to 
publish updates on the UI thread.
Parameters
params
The parameters of the task.
Returns
A result, defined by the subclass of this task.
See Also
onPreExecute()
onPostExecute(Result)
publishProgress(Progress...)


On Tuesday, December 18, 2012 12:08:51 PM UTC-6, Kristopher Micinski wrote:
>
> If you do that then the asynctask will run on the main thread... 
> probably not what you want... 
>
> OP: did you read an AsyncTask tutorial? 
>
> kris 
>
> On Tue, Dec 18, 2012 at 1:06 PM, bob <[email protected]<javascript:>> 
> wrote: 
> > Simply call the main method from the doInBackground method. 
> > 
> > 
> > 
> > 
> > On Tuesday, December 18, 2012 10:49:19 AM UTC-6, Antonis Kanaris wrote: 
> >> 
> >> 
> >>      How i convert this class code with AsyncTask method? 
> >> 
> >>             public class SimpleHttpPut { 
> >>     public static void main(String urlt,int t) { 
> >>         HttpClient client = new DefaultHttpClient(); 
> >>         HttpPost post = new HttpPost(urlt); 
> >>         try { 
> >>           List<NameValuePair> nameValuePairs = new 
> >> ArrayList<NameValuePair>(1); 
> >>           nameValuePairs.add(new 
> >> BasicNameValuePair("temp",String.valueOf(t))); 
> >>           post.setEntity(new UrlEncodedFormEntity(nameValuePairs)); 
> >> 
> >>           HttpResponse response = client.execute(post); 
> >>           BufferedReader rd = new BufferedReader(new 
> >> InputStreamReader(response.getEntity().getContent())); 
> >>           String line = ""; 
> >>           while ((line = rd.readLine()) != null) { 
> >>             System.out.println(line); 
> >>           } 
> >> 
> >>         } catch (IOException e) { 
> >>           e.printStackTrace(); 
> >>         } 
> >>       } 
> >> } 
> >> 
> > -- 
> > 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]<javascript:> 
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:> 
> > For more options, visit this group at 
> > http://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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to