2013年9月2日 星期一
0 意見

Android-Activity, Intent, Service, Content Providers, Broadcast Receivers, Application context

凌晨1:19
Android life cycle


Running State, 看到的 Activity.
Pause State, activity 沒有被 focus, 這種情境是在彈跳視窗較常發生。
Stopped State, 看不到 Activity, 但還存在 Memory中。
Destroyed State, 看不到 Activity, 並且不存在 Memory中。


Intents

Intent,觸發資料溝通的元件之一。


Service life cycle


Service,背景作業,無使用者互動介面, Services and activities runs on the same main application thread, often called on UI thread.


Content provider

Content Providers,應用程式之閶資料交換的介面.

CRUD principle, Create, read, update and delete.

Contacts application using Contacts Provider to get the data


Broadcast Receivers, 發佈和訂閱的機制,Observer Pattern.

Application context, 上面加一加就是了;Context.getApplicationContext() or Activity.getApplication();



Activity life cycle state




onSaveInstanceState


onRestoreInstanceState






O'REILLY  Learning Android.
O'REILLY  Programming Android.

0 意見:

張貼留言

 
Toggle Footer
Top