Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
を呼び出しintent.stopActivity()、そのアクティビティ内でインスタンス化時に AsyncTask を呼び出した場合: アクティビティを停止するとタスクはキャンセルされますか、それともバックグラウンドに残りますか?
intent.stopActivity()
stopActivityのメソッドを認識していませんが、呼び出しが「停止」されたときに、本当に停止状態に置かれているか終了しているかにかかわらずIntent、AsyncTaskは自動的にキャンセルされません。Activityこれを実現したい場合cancelはAsyncTask、適切なライフサイクル メソッドでActivitylikeを呼び出しますonStop。
stopActivity
Intent
AsyncTask
Activity
cancel
onStop