Android - Stop AsyncTask when back button is pressed and return to previous Activity
问题 I've an AsyncTask and I want it to stip execution when back button is pressed. I also want the app to return to the previous displayed Activity. It seems I've managed in stop the Task but the app doesn't return to the previous activity. Any ideas? This is an extract from my code private class MyTask extends AsyncTask<Void, Void, Void> implements OnDismissListener{ private boolean exception= false; @Override protected void onPreExecute(){ pd = ProgressDialog.show( IscrizioniActivity.this,