diff --git a/app/src/main/java/keijumt/devandroid/App.kt b/app/src/main/java/keijumt/devandroid/App.kt index b420221..39562a1 100644 --- a/app/src/main/java/keijumt/devandroid/App.kt +++ b/app/src/main/java/keijumt/devandroid/App.kt @@ -16,6 +16,9 @@ class App : DaggerApplication() { + // 現在のActivity + var currentActivity: Activity? = null + companion object { /** * Activity に dagger#inject を注入 @@ -68,6 +71,9 @@ } override fun onActivityStopped(activity: Activity?) { + if (currentActivity === activity) { + currentActivity = null + } } override fun onActivityCreated(activity: Activity?, bundle: Bundle?) {