1 Package Com.example.metrox.l13;2 3 import android.app.Application;4 import android.content.res.Configuration;5 import android.provider.Settings;6 7 /**8 * Created by Metrox on 2016/6/13.9 */Ten Public class App extends application { One private String textDate = "Default"; A - Public String gettextdate () { - return textDate; the } - - Public void Settextdate (String textDate) { - this.textdate = textDate; + } - + @Override A Public void OnCreate () { at super.oncreate (); - System.out.println ("App is creating ..."); - } - - @Override - Public void Onterminate () { in super.onterminate (); - System.out.println ("App terminated ..."); to } + - @Override the Public void onconfigurationchanged (Configuration newconfig) { * super.onconfigurationchanged (newconfig); $ System.out.println ("App config file has changed ...");Panax Notoginseng } - the @Override + Public void Onlowmemory () { A super.onlowmemory (); the System.out.println ("App low Memory ..."); + } - $ @Override $ Public void Ontrimmemory (Int. level) { - super.ontrimmemory (level); - System.out.println ("App memory cleanup ..."); the } -}
The life cycle of application