title: Object[] cannot be cast to Void[] in AsyncTask
body: <p>I'm getting this error inside an extended asynctask, but i'm really sure that Object[] IS a Void[].</p>
  
  <p>This is my custom AsyncTask:</p>
  
  <pre><code>public abstract class RepeatableAsyncTask&lt;A, B, C&gt; extends AsyncTask&lt;A, B, C&gt; {
  private static final String TAG = "RepeatableAsyncTask";
  public static final int DEFAULT_MAX_RETRY = 5;
  
  private int mMaxRetries = DEFAULT_MAX_RETRY;
  private Exception mException = null;
  
  /**
   * Default constructor
   */
  public RepeatableAsyncTask() {
      super();
  }
  
  /**
   * Constructs an AsyncTask that will repeate itself for max Retries
   * @param retries Max Retries.
   */
  public RepeatableAsyncTask(int retries) {
      super();
      mMaxRetries = retries;
  }
  
  /**
   * Will be repeated for max retries while the result is null or an exception is thrown.
   * @param inputs Same as AsyncTask's
   * @return Same as AsyncTask's
   */
  protected abstract C repeatInBackground(A...inputs);
  
  @Override
  protected final C doInBackground(A...inputs) {
      int tries = 0;
      C result = null;
  
      /* This is the main loop, repeatInBackground will be repeated until result will not be null */
      while(tries++ &lt; mMaxRetries &amp;&amp; result == null) {
          try {
              result = repeatInBackground(inputs);
          } catch (Exception exception) {
              /* You might want to log the exception everytime, do it here. */
              mException = exception;
          }
      }
      return result;
  }
  
  /**
   * Like onPostExecute but will return an eventual Exception
   * @param c Result same as AsyncTask
   * @param exception Exception thrown in the loop, even if the result is not null.
   */
  protected abstract void onPostExecute(C c, Exception exception);
  
  @Override
  protected final void onPostExecute(C c) {
      super.onPostExecute(c);
      onPostExecute(c, mException);
  }
  </code></pre>
  
  <p>And this is the SubClass that gives the problem:</p>
  
  <pre><code>public class ListPalinasAsynkTask extends RepeatableAsyncTask&lt;Void, Void, List&lt;Palina&gt;&gt;{
      private static final String TAG = "ListPalinasAsynkTask";
      private static final boolean D = SystemConstants.ACTIVE_DEBUG;
  
      private ApiRequest.ListPalinasCallback mCallback;
  
      public ListPalinasAsynkTask(ApiRequest.ListPalinasCallback callback) {
          if(D) Log.d(TAG, "Called: ListPalinasAsynkTask([callback])");
          mCallback = callback;
      }
  
      @Override
      protected List&lt;Palina&gt; repeatInBackground(Void... voids) {
          /* Here i send request to get palinas */
          return Api.getPalinasNearMe();
      }
  
      @Override
      protected void onPostExecute(List&lt;Palina&gt; palinas, Exception exception) {
          if(exception != null)
              Logging.e(TAG, "Received exception in Asynk Task", exception);
          if(palinas != null)
              mCallback.result(palinas);
          else
              mCallback.result(new ArrayList&lt;Palina&gt;());
      }
  }
  </code></pre>
  
  <p>Finally, this is the error:</p>
  
  <pre><code>E/ListPalinasAsynkTask﹕ Received exception in Asynk Task
      java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.Void[]
              at ListPalinasAsynkTask.repeatInBackground(ListPalinasAsynkTask.java:19)
              at RepeatableAsyncTask.doInBackground(RepeatableAsyncTask.java:43)
              at android.os.AsyncTask$2.call(AsyncTask.java:288)
  </code></pre>
  
  <p>I can't explain this exception because i'm giving Void as a parameter! That should not be an Object.
  Do you have solutions?</p>
  
  <p><strong>Edit</strong>:
  ListPalinasAsyncTask.java:19 refers to:</p>
  
  <pre><code>public class ListPalinasAsynkTask extends RepeatableAsyncTask&lt;Void, Void, List&lt;Palina&gt;&gt; {
  </code></pre>
  
  <p>RepeatableAsyncTask.java:43:</p>
  
  <pre><code>result = repeatInBackground(inputs);
  </code></pre>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>I'm calling execute this way:</p>
  
  <pre><code>AsyncTask mAsyncTask = new ListPalinasAsynkTask(callback);
  ....
  mAsyncTask.execute();
  </code></pre>