I am trying to raise a toast from asynctask, but I have problems setting the parameters. I'm toasts from onProgressUpdate, so I'm in the UI thread, which I think is correct. I think I'm wrong in the context parameter, what do I need to pass as a value?
EDIT: code display below
@Override
protected void onProgressUpdate(String... strings){
Toast toast = Toast.makeText(MainActivity.this, strings[0], Toast.LENGTH_LONG);
toast.show();
}
MainActivity.this says: "No instance of type MainActivity is available in scope." I am not sure what to convey as context.
thank
source
share