Android学习笔记之游标访问SQLite数据

Retrieving data 检索数据

Retrieving data from SQLite databases in Android is done using Cursor. The Android SQLite query method returns a Cursor object containing the results of the query. To use Cursor android.database.Cursor must be imported.
在安卓中使用Cursor接口来从SQLite database 中检索数据。SQLite 查询返回的Cursor包含查询所得结果的Cursor对象。使用Cursor时应当导入android.databaseCursor包。

About Cursor 关于Cursor

Cursor store query result records in rows and grant many methods to access and iterate through the records. Cursor should be closed when no longer used, and will be deactivated with a call to Cursor.deactivate() when the application pauses or exists. On resume the Cursor.requery() statement is executed to re-enable the Cursor with fresh data. These functions can be managed by the parent Activity by calling startManagingCursor().
Cursor将查询结果记录存放在列中,并且提供了许多方法来访问和迭代这些记录。如果Cursor不再使用的时候应当关闭掉,并且当应用程序暂停或者滞留时应当调用Cursor.deactivate()来使Cursor失效。在应用程序继续运行时,Cursor.requery()用来重新启动数据更新之后的Cursor。这些函数由父Activity调用startManagingCursor()进行管理。

package higherpass.TestingData;

import java.util.Locale;

import android.app.Activity;
import android.os.Bundle;
import android.content.ContentValues;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值