摘要: 1、创建NotificationManager管理通知,调用Context.getSystemService(Context.NOTIFICATION_SERVICE) 2、用Builder构造器创建Notification对象:Notification notification = new Not 阅读全文
posted @ 2017-02-16 23:10 yl007 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 1、通过Context的getContentRsolver()获取ContentResolver类的实例。 2、ContentResolver中接收的不是表明而是内容URI 3、解析内容URI获得Uri对象 4、返回值为Cursor对象,通过游标遍历Cursor取出数据 5、关闭Cursor 自定义 阅读全文
posted @ 2017-02-16 21:55 yl007 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 1、依赖:在app/build.gradle文件中的depenencies{compile 'org.litepal.android:core:1.3.2'} 2、配置litePal.xml:右击app/src/main-->New-->Directory,创建一个assets目录,在assets下 阅读全文
posted @ 2017-02-16 16:48 yl007 阅读(914) 评论(0) 推荐(0) 编辑
摘要: 动态注册广播接收器 1、创建一个Receiver继承BroadcastReceiver,并重写onReceiver() 2、在Activity的OnCreate()中添加广播接收器想要接收的action 3、注册广播接收器,调用registerReceiver(Receiver实例,intentFi 阅读全文
posted @ 2017-02-16 16:11 yl007 阅读(842) 评论(0) 推荐(0) 编辑