标签:ima onrestart des sum nbsp event undle void ons
测试回调代码
package com.example.hello; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; public class MainActivity extends AppCompatActivity { String TAG="myTag"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d(TAG, "on Create:"); } @Override protected void onStart(){ super.onStart(); Log.d(TAG,"on Start:"); } @Override protected void onResume(){ super.onResume(); Log.d(TAG,"on Resume:"); } @Override protected void onResumeFragments() { super.onResumeFragments(); } @Override protected void onPause() { super.onPause(); Log.d(TAG,"on Pause:"); } @Override protected void onStop() { super.onStop(); Log.d(TAG,"on Stop:"); } @Override protected void onRestart() { super.onRestart(); Log.d(TAG,"on Restart:"); } @Override protected void onDestroy() { super.onDestroy(); Log.d(TAG,"on Destroy:"); } }
测试结果
Activity LifeCycle (安卓应用的运行机制)
标签:ima onrestart des sum nbsp event undle void ons
原文地址:https://www.cnblogs.com/deepend/p/12243708.html