diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 27f1b84008..2e48c8f097 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -20,6 +20,7 @@ package eu.faircode.email; */ import android.content.SharedPreferences; +import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import android.util.Log; @@ -37,6 +38,24 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc super.onCreate(savedInstanceState); } + @Override + protected void onResume() { + Log.i(Helper.TAG, "Resume " + this.getClass().getName()); + super.onResume(); + } + + @Override + protected void onPause() { + Log.i(Helper.TAG, "Pause " + this.getClass().getName()); + super.onPause(); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + Log.i(Helper.TAG, "Config " + this.getClass().getName()); + super.onConfigurationChanged(newConfig); + } + @Override protected void onDestroy() { Log.i(Helper.TAG, "Destroy " + this.getClass().getName()); diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index c610d53550..4b483ec5a7 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -92,7 +92,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack @Override protected void onCreate(Bundle savedInstanceState) { - Log.i(Helper.TAG, "View create"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_view); @@ -256,7 +255,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack @Override protected void onPostCreate(Bundle savedInstanceState) { - Log.i(Helper.TAG, "View post create"); super.onPostCreate(savedInstanceState); drawerToggle.syncState(); } @@ -270,7 +268,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack @Override protected void onResume() { - Log.i(Helper.TAG, "View resume"); super.onResume(); LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this); @@ -288,7 +285,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack @Override protected void onPause() { - Log.i(Helper.TAG, "View pause"); super.onPause(); LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this); lbm.unregisterReceiver(receiver); @@ -296,14 +292,12 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack @Override public void onConfigurationChanged(Configuration newConfig) { - Log.i(Helper.TAG, "View configuration changed"); super.onConfigurationChanged(newConfig); drawerToggle.onConfigurationChanged(newConfig); } @Override protected void onDestroy() { - Log.i(Helper.TAG, "View destroyed"); super.onDestroy(); } diff --git a/app/src/main/java/eu/faircode/email/FragmentEx.java b/app/src/main/java/eu/faircode/email/FragmentEx.java index c138aa6b46..e40f58b983 100644 --- a/app/src/main/java/eu/faircode/email/FragmentEx.java +++ b/app/src/main/java/eu/faircode/email/FragmentEx.java @@ -1,5 +1,8 @@ package eu.faircode.email; +import android.content.res.Configuration; +import android.os.Bundle; +import android.util.Log; import android.view.View; import android.view.inputmethod.InputMethodManager; @@ -19,12 +22,31 @@ public class FragmentEx extends Fragment { updateSubtitle(); } + @Override + public void onCreate(Bundle savedInstanceState) { + Log.i(Helper.TAG, "Create " + this.getClass().getName()); + super.onCreate(savedInstanceState); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + Log.i(Helper.TAG, "Activity " + this.getClass().getName()); + super.onActivityCreated(savedInstanceState); + } + @Override public void onResume() { + Log.i(Helper.TAG, "Resume " + this.getClass().getName()); super.onResume(); updateSubtitle(); } + @Override + public void onPause() { + Log.i(Helper.TAG, "Pause " + this.getClass().getName()); + super.onPause(); + } + @Override public void onDetach() { super.onDetach(); @@ -35,6 +57,18 @@ public class FragmentEx extends Fragment { im.hideSoftInputFromWindow(focused.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } + @Override + public void onConfigurationChanged(Configuration newConfig) { + Log.i(Helper.TAG, "Config " + this.getClass().getName()); + super.onConfigurationChanged(newConfig); + } + + @Override + public void onDestroy() { + Log.i(Helper.TAG, "Destroy " + this.getClass().getName()); + super.onDestroy(); + } + private void updateSubtitle() { AppCompatActivity activity = (AppCompatActivity) getActivity(); if (activity != null) {