package com.example.activitylifecycle;
import android.app.Application;
import android.content.res.Configuration;
import android.util.Log;
public class MyApplication extends Application {
static final String TAG = "MyApplication";
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate");
}
@Override
public void onLowMemory() {
super.onLowMemory();
Log.d(TAG, "onLowMemory");
}
@Override
public void onTerminate() {
super.onTerminate();
Log.d(TAG, "onTerminate");
}
通过添加一些键(代码)帮助我理解这个概念。我是 android 新手,使用 Application 对象的目的是什么?