title: how to send data to AsyncTask from Activity?
body: <p>i am developing one application in that i have to send data to server .i got exception while get user details nullpointer exception please tell me where i made mistake </p>
  
  <p>myActivity code </p>
  
  <pre><code>userDetails = new DetailsDTO();
  
  userName = userNameEdit.getText().toString().trim();
  password = passwordEdit.getText().toString().trim();
  confirmPwd = confirmPasswordEdit.getText().toString();
  mobileNo = mobileNoEdit.getText().toString();
  
  userDetails.setUserName(userName);
  userDetails.setPassword(password);
  userDetails.setConfirmPwd(confirmPwd);
  userDetails.setMobileNumber(mobileNo);
  
  (new UserDetailsAsync(mContext)).execute();
  </code></pre>
  
  <p>My AsyncTask  code :                 </p>
  
  <pre><code>    @Override
          protected Void doInBackground(Void... params) {
              // TODO Auto-generated method stub
              httpClient  = new DefaultHttpClient();
              httpPost = new HttpPost(TrafficConstants.USER_REG_URL);
  
  
              Log.e("userName", details.getUserName());
              Log.e("pass", details.getPassword());
              Log.e("MOb",details.getMobileNumber());
  
              try{
              arrayList = new ArrayList&lt;NameValuePair&gt;(3);
              arrayList.add(new 
                      BasicNameValuePair("usr",details.getUserName()));
              arrayList.add(new 
                     BasicNameValuePair("pass",details.getPassword()));
              arrayList.add(new 
                     BasicNameValuePair("mob",details.getMobileNumber()));
              httpPost.setEntity(new UrlEncodedFormEntity(arrayList));
              HttpResponse response = httpClient.execute(httpPost);
              }
              catch(Exception e){
                  e.printStackTrace();
              }
              return null;
          }   
  </code></pre>
  
  <p>LogCat Error</p>
  
  <pre><code> 02-20 12:16:37.535: E/AndroidRuntime(2605): java.lang.RuntimeException: An error occured while executing doInBackground()
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at java.lang.Thread.run(Thread.java:856)
  02-20 12:16:37.535: E/AndroidRuntime(2605): Caused by: java.lang.NullPointerException: println needs a message
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at android.util.Log.println_native(Native Method)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at android.util.Log.e(Log.java:231)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at com.technowellServices.locationfind.UserRegistratrionActivity$UserDetailsAsync.doInBackground(UserRegistratrionActivity.java:150)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at com.technowellServices.locationfind.UserRegistratrionActivity$UserDetailsAsync.doInBackground(UserRegistratrionActivity.java:1)
  02-20 12:16:37.535: E/AndroidRuntime(2605):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
  </code></pre>