I have got a Fragment Activity that contains a textview and another class that extends AsyncTask. Now I would like to use the onPostExecute(String result)
method to set the result text in my textview that is in my fragment activity.
How can I do that? I already created a custom constructor for the AsyncTask class that takes in a context object. How can I use that??
This is how I create a task object in my Fragment activity:
String query = "someText";
Task task = new Task(this.getActivity());
task.execute(query);
This is a snippet from my task class:
public class Task extends AsyncTask<String, Void, String> {
private Context context;
public Task (Context context) {
this.context = context;
}
protected void onPostExecute(String result) {
super.onPostExecute(result);
// ??? What comes here ???
}
}