<nobr style="line-height:21px">abstract void</nobr> |
<nobr style="line-height:21px"><span style="line-height:21px; margin-right:2px"><a rel="nofollow" href="http://developer.android.com/reference/android/database/Cursor.html#unregisterContentObserver(android.database.ContentObserver)" style="color:rgb(0,102,153); line-height:21px; text-decoration:none">unregisterContentObserver</a></span>(<a rel="nofollow" href="http://developer.android.com/reference/android/database/ContentObserver.html" style="color:rgb(0,102,153); line-height:21px; text-decoration:none">ContentObserver</a>observer)</nobr>
|
<nobr style="line-height:21px">abstract void</nobr> |
<nobr style="line-height:21px"><span style="line-height:21px; margin-right:2px"><a rel="nofollow" href="http://developer.android.com/reference/android/database/Cursor.html#unregisterDataSetObserver(android.database.DataSetObserver)" style="color:rgb(0,102,153); line-height:21px; text-decoration:none">unregisterDataSetObserver</a></span>(<a rel="nofollow" href="http://developer.android.com/reference/android/database/DataSetObserver.html" style="color:rgb(0,102,153); line-height:21px; text-decoration:none">DataSetObserver</a>observer)</nobr>
|
Cursor还提供了重新查询的接口:
<nobr style="line-height:21px">abstract boolean</nobr> |
<nobr style="line-height:21px"><span style="line-height:21px; margin-right:2px"><a rel="nofollow" href="http://developer.android.com/reference/android/database/Cursor.html#requery()" style="color:rgb(0,102,153); line-height:21px; text-decoration:none">requery</a></span>()</nobr>
This method is deprecated. Don't use this. Just request a new cursor, so you can do this asynchronously and update your list view once the new cursor comes back.
|
Activity还提供了对Cursor进行管理的机制:
publicvoid
startManagingCursor(Cursorc)
Since:APILevel1
ThismethodallowstheactivitytotakecareofmanagingthegivenCursor'slifecycle
foryoubasedontheactivity'slifecycle.Thatis,whentheactivityisstopped
itwillautomaticallycalldeactivate()onthegivenCursor,
andwhenitislaterrestarteditwillcallrequery()foryou.
Whentheactivityisdestroyed,allmanagedCursorswillbeclosedautomatically.
参数
cTheCursortobemanaged.
publicfinalCursor
managedQuery(Uriuri,String[]projection,Stringselection,String[]selectionArgs,StringsortOrder)
Since:APILevel1
Wrapperaroundquery(android.net.Uri,String[],String,String[],String)thatgivestheresultingCursortocallstartManagingCursor(Cursor)sothattheactivitywillmanageitslifecycleforyou.参数uriTheURIofthecontentprovidertoquery.
projectionListofcolumnstoreturn.
selectionSQLWHEREclause.
selectionArgsTheargumentstoselection,ifany?sarepesent
sortOrderSQLORDERBYclause.
返回
*TheCursorthatwasreturnedbyquery().
注意:managedQuery就是查询了再调用了startManagingCursor,让Activity对Cursor进行管理。
相关推荐
Android cursor的详细说明,对于新手来说比较有用
android 使用 Cursor 访问数据库 生成 ListView 并获取选中项的值
本篇文章是对Android中Cursor相关的性能问题进行了详细的分析介绍,需要的朋友参考下
本文介绍如何在 Android 检测 Cursor 泄漏的原理以及使用方法,还指出几种常见的出错示例,同时该方法同样适合于其他需要检测资源泄露的情况,感兴趣的朋友可以了解下
在 Android Studio 中打开项目并在您的设备上运行。 前往“设置”>“辅助功能”并打开“鼠标光标”。 将mouse_udp_client.py的 IP 地址编辑为您的 Android 设备的 IP 地址 运行mouse_udp_client.py并使用屏幕上的...
本文简述了android的cursor的用法,通过本文你可以熟悉的掌握cursor的用法,通过实际的例程讲解
由于android系统中应用程序之间不能共享内存。因此,在不同应用程序之间交互数据(跨进程通讯)就稍微麻烦一些。在android SDK中提供了4种用于跨进程通讯的方式。这4种方式正好对应于android系统中4种应用程序组件:...
android在异步任务中如何关闭Cursor?在我们开发应用的时候,很多时候会遇到这种问题,下面我们就看看代码如何实现
sqlite数据库进阶 .doc查询语句返回的结果都是Cursor,但对于Cursor数据类型,各大数据库的使用方法...Cursor是一个泛型数据集,尽管android中Cursor数据的读取方式比较灵活,不过一般还是需要遵循以下一个必要的步骤:
import android.database.Cursor; import android.database.sqlite.SQLiteCursor; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android....
Android App调试内存泄露之Cursor.zip
包括:android gravity 和 android layout_Gravity,Bundle,ContentResolver,cursor,Fragments ,Fragments,inflater ,Fragment,数据查询query函数参数解析, 【Cursor】 类的介绍,android 获得通话记录,Handler ,...
Android 基于libaums实现读写U盘文件,相关博客:https://blog.csdn.net/a512337862/article/details/80505128
《深入理解Android:卷2》不仅继承了第1本书的优点并改正了其在细微处存在的一些不足,而且还在写作的总体思想上进行了创新,更强调从系统设计者的角度去分析Android系统中各个模块内部的实现原理和工作机制。...
import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DB_Table_Number extends SQLiteOpenHelper { private ...
2.4.2 安装和配置Eclipse中Android插件 2.5 使用Eclipse开发Android应用程序 2.5.1 使用Eclipse创建Android项目 2.5.2 Eclipse中Android项目架构 2.5.3 Eclipse中Android项目的调试和运行 第3章 Android中的Activity...
在每章的讲解中,它会让你通过一系列示例项目逐步掌握Android中的各种新功能和技术,助你取得最圆满的学习效果。本书所介绍的各个应用实例简明扼要且极具实用价值,它们覆盖了Android 1.0的所有基本功能和高级功能...