PrintStatusTask parses the contents of a gmail inbox looking for various items of interest to report on. But a new AsyncTask is created for each PrintStatusTask().execute() according to the debugger. Shouldn't these tasks die on exit? Do they have to be killed manually?
public class Controller extends Activity {
...
private boolean applyMenuChoice(MenuItem item) {
switch (item.getItemId()) {
case R.id.menuStatus:
new PrintStatusTask().execute();
...
class PrintStatusTask extends AsyncTask<Void, String, Void> {
@Override
protected Void doInBackground(Void... unused) {
...
return null;
}
@Override
protected void onPostExecute(Void unused) {
this.cancel(true);
}
}
}