freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

android應用開發(fā)簡介(編輯修改稿)

2025-06-16 21:59 本頁面
 

【文章內容簡介】 務常用生命周期回調方法如下: onCreate() 該方法在服務被創(chuàng)建時調用,該方法只會被調用一次,無論調用多少次 startService()或 bindService()方法,服務也只被創(chuàng)建一次。 onDestroy()該方法在服務被終止時調用。 ? 與采用 ()方法啟動服務有關的生命周期方法 onStart() 只有采用 ()方法啟動服務時才會回調該方法。該方法在服務開始運行時被調用。多次調用 startService()方法盡管不會多次創(chuàng)建服務,但 onStart() 方法會被多次調用。 ? 與采用 ()方法啟動服務有關的生命周期方法 onBind()只有采用 ()方法啟動服務時才會回調該方法。該方法在調用者與服務綁定時被調用,當調用者與服務已經綁定,多次調用 ()方法并不會導致該方法被多次調用。 onUnbind()只有采用 ()方法啟動服務時才會回調該方法。該方法在調用者與服務解除綁定時被調用。 采用 startService()啟動服務 采用 ()方法啟動服務的代碼如下: public class HelloActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { ...... Button button =(Button) ()。 (new (){ public void onClick(View v) { Intent intent = new Intent(, )。 startService(intent)。 }})。 } } 采用 bindService()啟動服務 采用 ()方法啟動服務的代碼如下: public class HelloActivity extends Activity { ServiceConnection conn = new ServiceConnection() { public void onServiceConnected(ComponentName name, IBinder service) { } public void onServiceDisconnected(ComponentName name) { } }。 @Override public void onCreate(Bundle savedInstanceState) { Button button =(Button) ()。 (new (){ public void onClick(View v) { Intent intent = new Intent(, )。 bindService(intent, conn, )。 //unbindService(conn)。//解除綁定 }})。 } } 何為 Content provider ? 什么是 Content provider? – Content Provider 是 Android應用程序的四大組成部分之一 – 是 android中的跨應用訪問數(shù)據(jù)機制 ? 為何需要 content provider? – Android中每一個 app的資源是私有的 – app通過 content provider和其他 app共享私有數(shù)據(jù) 如何使用 content provider ? 通過 content resolver訪問 ?() app ContentResolver ContentProvider A ContentProvider B ContentResolver ContentResolver app app 如何使用 content provider ? URI定位資源 – – ? 類似關系數(shù)據(jù)庫的訪問方式 ? 以二維數(shù)據(jù)表的格式暴露數(shù)據(jù),缺省都包含 _id字段 delete(Uri url, String where, String[] selectionArgs) insert(Uri url, ContentValues values) query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) update(Uri uri, ContentValues values, String where, String[] selectionArgs) 定義自己的 content prov
點擊復制文檔內容
試題試卷相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1