と呼ばれていない誰もが自分自身のコールfinish()
、それだけでonPause()
を呼び出し、onStop()
とonDestroy()
を呼び出していない場合、FragmentActivity
の問題を持っています。しかし、活動はデバイス上で見えませんか?アンドロイドFragmentActivityは)目に見えないが、onStop(ある
他のエラーログは表示されません。
アンドロイドの活動のライフサイクルに応じて、アクティビティが見えない場合は、onstop()
を呼び出す必要があります。そうではありません。これはAndroid 5.0で発生します。
原因を見つけましたが、なぜそれが起こったのか分かりません。
AはFragmentActivityを拡張し、launchmode:singleTaskを定義します。
Bアクティビティは、Manifestのandroid:launchMode = "singleInstance"、android:theme = "@アンドロイド:style/Theme.NoDisplay"と定義されています。
CはFragmentActivityを拡張し、マニフェストではlaunchmode:singleTask、android:excludeFromRecents = "true"、android:taskAffinity = "com.xxx.xxxx.xxx"と定義されています。
Dは、serviceConnectorシングルトンインスタンスです。バインディングサービスコールバックからイベントを処理します。
シナリオは次のとおりです。
Step1 : A calls B with startActivity(intent).
Step2 : B calls serviceConnector to send event to the service process and finish itself. It has no UI. It is set as Theme.NoDisplay.
Step3 : Service callbacks init C if not exist yet and C handle service responses event.
Step4 : In one case, C calls B with startActivity(intent)
Step5 : B calls serviceConnection to send event. No UI. C will onPause and when B finsih itself, C onResume()
Step6: Service callbacks and found C already exist, no create new one. C handle service respsonses.
Step7: user click button on C Fragement activity, C calls finish itself, But only C got onPause(). C couldn't be finish, no onStop(), no onDestroy() is called.
私はCはB、Bのfinsih自体は、C再開とCの仕上がり自体は、後で問題があり呼び出す理解していません。
あなたはonPause()のsuperメソッドを呼び出していますか?super.onPause() – danny117
はい、super.onPauseが呼び出されます。私は私の質問を更新しました。私はその原因を見つけた。しかし、なぜ私は理解していない。 –