title: FATAL EXCEPTION: AsyncTask
body: <p>Today i am facing a problem in android app while executing AsyncTask.exception log is -</p>
  
  <pre><code>   FATAL EXCEPTION: AsyncTask #1
     java.lang.RuntimeException: An error occured while executing doInBackground()
     at android.os.AsyncTask$3.done(AsyncTask.java:299)
     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
     at java.lang.Thread.run(Thread.java:838)
     Caused by: java.lang.ClassCastException: java.lang.Object[] cannot be cast to          java.lang.Void[]
     at com.android.demo.DashBoardActivity$3.doInBackground(DashBoardActivity.java:1)
     at android.os.AsyncTask$2.call(AsyncTask.java:287)
     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  </code></pre>
  
  <p>i am not getting what the error is and why app force close.
  This situation not occur after first run but from second run of app cause exception.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDITED-</p>
  
  <p>i am using following method in DashBoardActivity for register to GCM-</p>
  
  <pre><code>public void registerToGCM(){
      try{
            GCMRegistrar.checkDevice(this);
            GCMRegistrar.checkManifest(this);
            registerReceiver(mHandleMessageReceiver, new IntentFilter(
                      AppConstents.DISPLAY_MESSAGE_ACTION));
  
              final String regId = GCMRegistrar.getRegistrationId(this);
              if (regId.equals("")) {
                  GCMRegistrar.register(this, AppConstents.SENDER_ID);
              } else {
                  if (GCMRegistrar.isRegisteredOnServer(this)) {
                      Toast.makeText(getApplicationContext(), "Already registered with GCM", Toast.LENGTH_LONG).show();
                  } else {
                      final Context context = this;
                      final AsyncTask mRegisterTask = new AsyncTask&lt;Void, Void, Void&gt;() {
  
                          @Override
                          protected Void doInBackground(Void... params) {
                              GCMServerUtilities.register(context,regId);
                              return null;
                          }
  
                          @Override
                          protected void onPostExecute(Void result) {
                            //  mRegisterTask = null;
                          }
  
                      };
                      mRegisterTask.execute(null, null, null);
                  }
              }
      }
      catch(Exception e){
          e.printStackTrace();
      }
  }
  </code></pre>