title: how to use asyn task in webservice android
body: <p>This webservice is working fine in 2.3 android but not working in 4.0 and above when I load the same application in 4.0 it force closes the application please help me in this </p>
  
  <pre><code>public int call1()
  {
      try
      {
  
          SoapObject request = new SoapObject(NAMESPACE1, METHOD_NAME1);
          //           request.addProperty("CompanyNmae", a); //           request.addProperty("ShopNumber", b); //           
          request.addProperty("LicenseNumber", c); //         
          request.addProperty("RecipientName", d); //         
          request.addProperty("Fine", DD2);
  
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envelope.dotNet = true;
          envelope.setOutputSoapObject(request);
  
          HttpTransportSE androidHttpTransport = new HttpTransportSE(URL1);
          androidHttpTransport.call(SOAP_ACTION1, envelope);
          // HttpResponse response = request.execute(androidHttpTransport);
          // Object result = envelope.getResponse();
  
          Object result = envelope.getResponse();
          Result = result.toString();
  
          // Toast.makeText(this, Result, Toast.LENGTH_LONG).show();
          //Result = result.getProperty(1).toString();
          // Result = result.getAttribute("CompanyName").toString(); //           Result = result.getProperty(2).toString();
          //           textView3 = (TextView) findViewById(R.id.textView3); //             //              //         
          textView3.setText(Result);
          // Toast.makeText(this, Result, Toast.LENGTH_LONG).show();
          return 1;
  
      }
      catch (Exception e)
      {
          Toast.makeText(this, "Error in Method 'Call' ", Toast.LENGTH_LONG).show();
          //Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
  
          return 0;
      }
  }
  </code></pre>
  
  <p>And here is my Error log :</p>
  
  <pre><code>08-19 11:20:56.348: E/AndroidRuntime(5583): FATAL EXCEPTION: main 08-19 11:20:56.348: E/AndroidRuntime(5583): java.lang.NullPointerException 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at com.inventorymanagement.Password.Customer(Password.java:440)
  
  08-19 11:20:56.348: E/AndroidRuntime(5583): at com.inventorymanagement.Password.access$2(Password.java:396) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at com.inventorymanagement.Password$2.onClick(Password.java:127) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at android.view.View.performClick(View.java:4212) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at android.view.View$PerformClick.run(View.java:17476) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at android.os.Handler.handleCallback(Handler.java:800) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at android.os.Handler.dispatchMessage(Handler.java:100) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at android.os.Looper.loop(Looper.java:194) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at android.app.ActivityThread.main(ActivityThread.java:5371) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at java.lang.reflect.Method.invokeNative(Native Method) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at java.lang.reflect.Method.invoke(Method.java:525) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 
  08-19 11:20:56.348: E/AndroidRuntime(5583): at dalvik.system.NativeStart.main(Native Method)
  </code></pre>