How to pass a Context object to a stream upon call
I have this piece of code:
public static class ExportDatabaseFileTask extends AsyncTask<String, Void, Boolean>
{
private final ProgressDialog dialog = new ProgressDialog(ctx);
protected void onPreExecute();
protected Boolean doInBackground(final String... args);
protected void onPostExecute(final Boolean success);
}
I am executing this thread as
new ExportDatabaseFileTask().execute();
As you can see I am using ctx as Context variable in new call to ProgressDialog, how can I pass context to call method?
to that:
new ExportDatabaseFileTask().execute();*
+2
a source to share
3 answers