首页 > 代码库 > Android 基础

Android 基础

Activity ,Service,Content Provider,BroadcastReceiver, Intent 

SQLite,Http,Fragement,Handle

 

1,Activity: 

onCreate ——> onStart——> onResume——> onPause()——> onStop——> onDestroy

2,Service:

1) onCreate——> onStart(Intent intent,int startId)——> onDestroy

startService(serviceIntent) /stopService(serviceIntent)

2)如果希望启动服务的Activity关闭后Service自动关闭,就需要讲Activity与Service绑定。

public boolean bindService(Intent service,ServiceConnection conn ,int flags)  //flags一般为Context.BIND_AUTO_CREATE

 

 

2)AIDL

Android 基础