i have a method that does an SQLite database update and put this inside of an AsyncTask to make it faster and more reliable.
however there are two pieces of data tha
Just pass the required object in the constructor of your async task and later use this object in doinBackground().You can create constructor and pass the your object in the following way:
public class MyAsyncTask extends AsyncTask{
PrimaryKeySmallTank tankObj;
public UpdateInfoAsyncTask(PrimaryKeySmallTank obj ){
tankObj=obj;
}
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
}
@Override
protected Void doInBackground(Void... params) {
//code and use tankObj
return null;
}
}
In your code pass the required object:
new myAsyncTask(new PrimaryKeySmallTank (1,1,1,"hi",1).execute();