title: how to pass in two different data types to AsyncTask, Android
body: <p>i have a method that does an SQLite database update and put this inside of an AsyncTask to make it faster and more reliable.</p>
  
  <p>however there are two pieces of data that are needed to update the database. one is an Integer and the other is an object of the PrimaryKeySmallTank class that is shown here.</p>
  
  <p>using the params array in the arguments of the doInBackground method of AsyncTask, i can pass an Integer in, but what if I have two different types of data like here?</p>
  
  <p>if an integer is stored in int... params[0]  i cannot store a different type object in params[1],  so what can be done about this?</p>
  
  <p>object i want to pass into the AsyncTask</p>
  
  <pre><code>public class PrimaryKeySmallTank {
  
  int contractNumber;
  int customerCode;
  int septicCode;
  String workDate;
  int workNumber;
  
  }
  </code></pre>
  
  <p>the AsyncTask that i am using</p>
  
  <pre><code> public class UpdateInfoAsyncTask extends AsyncTask&lt;Integer, Void, Void&gt;{
  
    @Override
    protected void onPreExecute() {
     // TODO Auto-generated method stub
  
    }
  
    @Override
    protected Void doInBackground(Integer... params) {
        Integer mIntegerIn = params[0];  // this is what I want to do, example
        PrimaryKeySmallTank mPrimaryKeySmallTank = params[1];  // different data type to pass in
  
        Database db = new Database(InspectionInfoSelectionList.this);
          db.openToWrite();
          db.updateWorkClassificationByRow(mPrimaryKeySmallTank, mIntegerIn);
          db.close();
  
             return null;
    }
  
   } // end UpdateInfoAsyncTask
  </code></pre>