- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
小米,魅族监听短信问题(Millet, Meizu monitor SMS problems)
小米,魅族监听短信问题(Millet, Meizu monitor SMS problems)
In millet, Meizu listening SMS broadcast, you will find that can not monitor, this is where we need to monitor the SMS database.
In general, a class inherits ContentObserver as an observer, and when the database changes, the ContentObserver is notified to update it.
Example:
Public, class, ScreenTest, extends, Activity {
Class SmsContent extends ContentObserver{
Private, Cursor, cursor = null;
Public SmsContent (Handler, handler) {
Super (handler);
}
/ * *
* @Description calls this method when a short message table is sent
* requires two permissions
* android.permission.READ_SMS reads text messages
* android.permission.WRITE_SMS writes short messages
* @Author Snake
* @Date 2010-1-12
* /
@Override
Public, void, onChange (Boolean, selfChange) {
Auto-generated method stub / / TODO
Super.onChange (selfChange);
SMS read the specified number in inbox
Cursor = managedQuery (Uri.parse (content://sms/inbox), new, _id, address, String[]{, read,} address=, and, read=, new String[]{, 12345678901, 0, date, desc);
If (cursor = = null) {
ContentValues values = new, ContentValues ();
Values.put (read, 1); / / modify messages as read mode
Cursor.moveToFirst ();
While (cursor.isLast ()) {
/ / update the current state to read unread messages
GetContentResolver ().Update (Uri.parse (content://sms/inbox), values, _id=, new String[]{, +cursor.getInt (0)};
Cursor.moveToNext ();
}
}
}
}
Called when the activity is first / * * * created.
@Override
Public, void, onCreate (Bundle, savedInstanceState) {
Super.onCreate (savedInstanceState);
SetContentView (R.layout.main);
SmsContent content = new SmsContent (new, Handler ());
SMS / registration monitor changes
This.getContentResolver ().RegisterContentObserver (Uri.parse (content://sms/), true, content);
}
}
Can I use it, I dont know, but this one will work
Public, class, MainActivity, extends, Activity {
Class SmsContent extends ContentObserver{
Private Handler handler;
Public SmsContent (Handle
您可能关注的文档
- 如何运作医院市场终端 (上)(How to operate the hospital market terminal (top)).doc
- 如何运作完美完整版(How to operate the perfect full version).doc
- 如何运用收益法评估企业价值(How to evaluate enterprise value by income approach).doc
- 如何衡量管理者的领导力(How to measure the leadership of managers).doc
- 如何运营地方性人才网(How to operate a local talent network).doc
- 如何进行图纸会审(How to make drawings).doc
- 如何购买办公家具专家讲解理性购买(How to buy office furniture Experts explain rational buying).doc
- 如何进行岗位评价(How to evaluate post).doc
- 如何进行工作考核(How to perform a job assessment).doc
- 如何进行异地财务监管(How to carry out financial supervision in different places).doc
- 小贴士什么是sap中的mm模块(Tip what is the MM module in sap).doc
- 小额信贷发放现状及对策(Current situation and Countermeasures of micro credit payment).doc
- 小高考生物复习资料(Biological examination materials for small college entrance examination).doc
- 小额贷款公司日常人事管理制度(The daily personnel management system of micro credit company).doc
- 小麦瘦身课堂(Wheat slimming classroom).doc
- 少儿二胡演奏常见毛病及纠正(Common faults and correction of children's Erhu performance).doc
- 小鼠 tnf-α elisa试剂盒说明书(Mouse tnf- alpha ELISA Kit).doc
- 少多是话电服客宝淘(Few words are electric clothes, customers treasure Amoy).doc
- 少输善输(Less lose good lose).doc
- 少花钱多办事 超值二手单反选购全攻(Spend less money, work value, second-hand SLR, buy all).doc
文档评论(0)