I have the following class:
public class getURLData extends AsyncTask{
@Override
protected String doInBackground(String... pa
Get the context in the constructor like this:
public GetDataTask(Context context) {}
Create an Interface with the method:
void onDataRetrieved(String data);
Implement the Interface in the class from where you are creating the Task object (e.g. MainActivity
)
Cast the Context to the Interface and call the onDataRetrieved Method