Log activity/fragment life cycle

This commit is contained in:
M66B
2018-08-11 16:13:22 +00:00
parent 3826ca76d5
commit 42a4de8931
3 changed files with 53 additions and 6 deletions

View File

@@ -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) {