通过ContentProvider监听数据库中数据变化

上传者: kern_ | 上传时间: 2022-10-24 15:48:59 | 文件大小: 2.41MB | 文件类型: ZIP
通过ContentProvider(内容提供者)将app中数据库对外开放(当然也可以对app本身开发);然后对数据库的增删改查就通过ContentProvider来实现;然后用ContentObserver(内容观察者)来监听数据是否有变化。当有变化则就调用onChange方法了!

文件下载

资源详情

[{"title":"( 62 个子文件 2.41MB ) 通过ContentProvider监听数据库中数据变化","children":[{"title":"ContentProvider监听数据库中数据变化","children":[{"title":"监听数据库中数据变化","children":[{"title":"bin","children":[{"title":"classes.dex <span style='color:#111;'> 1.20MB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"crunch","children":[{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 187B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 199B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 256B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 190B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"监听数据库中数据变化.apk <span style='color:#111;'> 388.95KB </span>","children":null,"spread":false},{"title":"jarlist.cache <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"xUtils-2.6.14-10f8a9d0b1bc0a18896ba8f85a878a04.jar <span style='color:#111;'> 112.43KB </span>","children":null,"spread":false},{"title":"xUtils-2.6.14-2933ee26009c6f2d8f056bdb6516aa1a.jar <span style='color:#111;'> 112.50KB </span>","children":null,"spread":false},{"title":"android-support-v4-3925359a5525bba8f13b021c57710121.jar <span style='color:#111;'> 267.35KB </span>","children":null,"spread":false},{"title":"android-support-v4-8e490bc2dfba6701161e5432f0cc28d2.jar <span style='color:#111;'> 267.37KB </span>","children":null,"spread":false}],"spread":true},{"title":"classes","children":[{"title":"org","children":[{"title":"keenr","children":[{"title":"refreshsql","children":[{"title":"MainActivity.class <span style='color:#111;'> 5.26KB </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 349B </span>","children":null,"spread":false},{"title":"MainActivity$1.class <span style='color:#111;'> 1.49KB </span>","children":null,"spread":false},{"title":"content","children":[{"title":"PersonProvider.class <span style='color:#111;'> 3.07KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$layout.class <span style='color:#111;'> 442B </span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'> 623B </span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 413B </span>","children":null,"spread":false},{"title":"db","children":[{"title":"Modify.class <span style='color:#111;'> 2.36KB </span>","children":null,"spread":false},{"title":"OrgHelper.class <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$dimen.class <span style='color:#111;'> 467B </span>","children":null,"spread":false},{"title":"MainActivity$PersonObserver.class <span style='color:#111;'> 937B </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 346B </span>","children":null,"spread":false},{"title":"R$menu.class <span style='color:#111;'> 394B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 693B </span>","children":null,"spread":false},{"title":"adapter","children":[{"title":"ListViewAdapter$Holder.class <span style='color:#111;'> 613B </span>","children":null,"spread":false},{"title":"ListViewAdapter.class <span style='color:#111;'> 2.61KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$string.class <span style='color:#111;'> 478B </span>","children":null,"spread":false},{"title":"util","children":[{"title":"Person.class <span style='color:#111;'> 1.38KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$style.class <span style='color:#111;'> 437B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"resources.ap_ <span style='color:#111;'> 6.36KB </span>","children":null,"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false}],"spread":true},{"title":"res","children":[{"title":"drawable-ldpi","children":null,"spread":false},{"title":"values-v11","children":[{"title":"styles.xml <span style='color:#111;'> 334B </span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"main.xml <span style='color:#111;'> 370B </span>","children":null,"spread":false}],"spread":true},{"title":"values-v14","children":[{"title":"styles.xml <span style='color:#111;'> 391B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 206B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 242B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 403B </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 247B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 697B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 220B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 176B </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"list_item.xml <span style='color:#111;'> 531B </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 2.08KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-w820dp","children":[{"title":"dimens.xml <span style='color:#111;'> 381B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 2.16KB </span>","children":null,"spread":false},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"org","children":[{"title":"keenr","children":[{"title":"refreshsql","children":[{"title":"BuildConfig.java <span style='color:#111;'> 162B </span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'> 2.96KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"org","children":[{"title":"keenr","children":[{"title":"refreshsql","children":[{"title":"content","children":[{"title":"PersonProvider.java <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false}],"spread":true},{"title":"db","children":[{"title":"OrgHelper.java <span style='color:#111;'> 833B </span>","children":null,"spread":false},{"title":"Modify.java <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false}],"spread":true},{"title":"MainActivity.java <span style='color:#111;'> 4.32KB </span>","children":null,"spread":false},{"title":"adapter","children":[{"title":"ListViewAdapter.java <span style='color:#111;'> 1.62KB </span>","children":null,"spread":false}],"spread":false},{"title":"util","children":[{"title":"Person.java <span style='color:#111;'> 745B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'> 866B </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 475B </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 740.94KB </span>","children":null,"spread":false},{"title":"xUtils-2.6.14.jar <span style='color:#111;'> 276.92KB </span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明