LoginSignup
2
1

More than 5 years have passed since last update.

アプリが勝手に起動する?非同期処理後にContext.startActivity呼び出しは注意

Posted at

AndroidでActivityの起動はContext.startActivityメソッドにIntentを渡して行うと思います。

この処理を非同期処理後に実行しているとアプリがバックグラウンドにいても、本処理が呼ばれて勝手Activityが起動します。

ユーザからすると勝手にアプリが起動するので煩わしく感じるかもしれません。

特に、起動時にSplashのActivityが表示されて、その後にメインのActivityが表示される構成で、この振る舞いをしがちなので、注意が必要です。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1