How can I pass a Context object to a thread on call
- by Pentium10
I have this code fragment:
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 execute this thread as
new ExportDatabaseFileTask().execute();
As you see I use a ctx as Context variable in the new ProgressDialog call, how do I pass a context to the call method?
to this one:
new ExportDatabaseFileTask().execute();*