I’m trying to start an Activity in my AsyncTask from the doInBackground() method but it doesn’t seem to start.
I’ve passed the Activity of which I call the AsyncTask from using params[0].
public class StartProcess extends AsyncTask<Main, Void, Main>
{
@Override
protected Main doInBackground(Main... params) {
return params[0];
}
protected void onPostExecute(Main... params) {
// TODO Auto-generated method stub
System.out.println("post");
Intent loc = new Intent(params[0],LocationHandler3.class);
loc.putExtra("locationType",0);
loc.putExtra("startEndType",0);
params[0].startActivity(loc);
}
}
use this modified code.