Application一般用来保持全局数据的。

 
1.Application的
onCreate( )方法(尽量不做耗时的操作)
API:解释
Called when the application is starting, before any other application objects have been created.
程序启动的时候,先于任何组件调用
 
2.Application的
onTerminate ( )方法
 

Called when the application is stopping. There are no more application objects running and the process will exit. Note: never depend on this method being called; in many cases an unneeded application process will simply be killed by the kernel without executing any application code. If you override this method, be sure to call super.onTerminate().

当程序停止后,程序没有任何组件并且进程退出后,再会调用。