In the onCreate() event of an Activity, I have started an AsyncTask to retrieve Product data from a database. After this has been completed successfully, how can I update th
I am guessing the question is more about how to get hold of the UI View if the asyncTask is in a separate file .
In that case you have to pass the context to the Async task and use that to get the view.
class MyAsyncTask extends AsyncTask {
Activity mActivity;
public MyAsyncTask(Activity activity) {
mActivity = ativity;
}
And then in your onPostExecute use
int id = mActivity.findViewById(...);
Remember you cannot update the View from "doInBackground" since its not the UI thread.