how to use handler to run a task in background
<p>I am using following code to to access web service and its showing me error application no responding.</p>

<pre><code>package com.android.webservice;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class WebServiceActivity extends Activity {
    private static final String SOAP_ACTION = "http://tempuri.org/HelloWorld";

    private static final String METHOD_NAME = "HelloWorld";

    private static final String NAMESPACE = "http://tempuri.org/";
    private static final String URL = "http://192.168.1.19/TestWeb/WebService.asmx";


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);



        Button getquote = (Button) findViewById(R.id.getquote);  
        getquote.setOnClickListener(new OnClickListener() {  

        public void onClick(View v) { 
            TextView result1;
            result1=(TextView)findViewById(R.id.result1);
        try {


            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
            EditText CompanyName = (EditText) findViewById(R.id.CompanyName); 
            String val1 = (CompanyName.getText().toString());
            request.addProperty("passonString", val1);

            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.dotNet=true;
            envelope.setOutputSoapObject(request);

            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
            androidHttpTransport.call(SOAP_ACTION, envelope);

            Object result = (Object)envelope.getResponse();

            result1.setText(result.toString());
        } catch (Exception e) {

            result1.setText(e.getMessage());
            }
    }
});
    }
}
</code></pre>

<p>May be because this is running in UI thread, I want to run it in background using handler i am new in this field so having  poroblem to write it in background thread . Can anyone please give me direction, how to write the code inside handler.
Thanks</p>
