摘要:
主要是调用现成的ContentProvider...ContentResolver是通过URI来查询ContentProvider中提供的数据.在android中,每个应用程序是可以实现数据共享的,都拥有一个contentprovider实例,而contentresolver用于管理程序的contentprovider实例.首先需要获得一个ContentResolver的实例,可通过Activity的成员方法getContentResovler()方法:ContentResolver contentResolver = getContentResolver();ContentResolver实 阅读全文
随笔档案-2012年4月27日
Service应用
2012-04-27 14:50 by ...平..淡..., 251 阅读, 收藏,
摘要:
Service的生命周期Service对象不能自己启动,需要通过某个Activity、Service或者其他Context对象来启动。启动的方法有两种,Context.startService和Context.bindService()。两种方式的生命周期是不同的,具体如下所示。Context.startService方式的生命周期: 启动时,startService–> onCreate() –> onStart() 停止时,stopService–> onDestroy()Context.bindService方式的生命周期:绑定时,bindService-> on 阅读全文
浙公网安备 33010602011771号