• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps may have two AsyncTask classes in ONE java file(=Activity file)

error: void error dimension expected after
// performs database query outside GUI thread
private class SaveSharedPreferences extends AsyncTask<String, Object, Object> // error: void error dimension expected after ....
{
SharedPreferences.Editor preferencesEditor = savedSearches.edit();
// store current search

// perform the database access
@Override
protected Object doInBackground(String... params)
{
preferencesEditor.putString(params[1], params[0]);
preferencesEditor.apply(); // store the updated preferences
return null;
} // end method doInBackground

// use the Cursor returned from the doInBackground method
@Override
protected void onPostExecute(Object obj)
{

} // end method onPostExecute
} // end class LoadContactTask
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones