package com.example.lifecyclelog;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.LoaderManager;
import android.view.Menu;
import static com.example.lifecyclelog.Util.LifecycleState.CALL_TO_SUPER;
import static com.example.lifecyclelog.Util.LifecycleState.RETURN_FROM_SUPER;
import static com.example.lifecyclelog.Util.recLifeCycle;
/**
* A standard v4 support version of Activity.
*/
public class MainFragmentActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onCreate(savedInstanceState);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
setContentView(R.layout.activity_main_compat);
FragmentManager.enableDebugLogging(true);
LoaderManager.enableDebugLogging(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
recLifeCycle(getClass(), CALL_TO_SUPER);
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
return true;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onActivityResult(requestCode, resultCode, data);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onAttachedToWindow() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onAttachedToWindow();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onAttachFragment(Fragment fragment) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onAttachFragment(fragment);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onConfigurationChanged(newConfig);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onContentChanged() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onContentChanged();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onDestroy() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onDestroy();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onDetachedFromWindow() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onDetachedFromWindow();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onNewIntent(Intent intent) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onNewIntent(intent);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onPause() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onPause();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onPostCreate(savedInstanceState);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onPostResume() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onPostResume();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public boolean onPrepareOptionsMenu(final Menu menu) {
recLifeCycle(getClass(), CALL_TO_SUPER);
boolean result = super.onPrepareOptionsMenu(menu);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
return result;
}
@Override
protected void onRestart() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onRestart();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onRestoreInstanceState(final Bundle savedInstanceState) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onRestoreInstanceState(savedInstanceState);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onResume() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onResume();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onResumeFragments() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onResumeFragments();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onSaveInstanceState(final Bundle outState) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onSaveInstanceState(outState);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onWindowFocusChanged(hasFocus);
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onUserLeaveHint() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onUserLeaveHint();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onStart() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onStart();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
protected void onStop() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onStop();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
@Override
public void onUserInteraction() {
recLifeCycle(getClass(), CALL_TO_SUPER);
super.onUserInteraction();
recLifeCycle(getClass(), RETURN_FROM_SUPER);
}
}
Android Fragment Lifecycle
52 浏览量
2023-10-15
22:49:44
上传
评论
收藏 44KB ZIP 举报
川峰
- 粉丝: 1348
- 资源: 34
最新资源
- 嵌入式基础学习资料0000
- content_1714465331721.xls
- HM3401-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- Chainbase+Web3+APi+Data warehouse
- HM3401D-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- GEE案例-1990-2023年计算某个区域的NDVI时序变化轨迹(以徐州市为例)含全部代码.pdf
- HM3401C-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 沈丘盛世龙门图纸符合规范化
- 基于51单片机带LCD1602显示+温度补偿的超声波测距仪设计软硬设计+仿真+文档资料.zip
- 一、K210是什么? K210全称为堪智K210,是嘉楠科技自主研发的一款采用RISC-V处理器架构,具备视听一体、自主IP内核
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈