android中cursor对象的使用
cursor对象是使用行来存储数据的,你要使用它获得数据,就必须知道每一列的数据名称以及他的数据类型才能获得对象数据
常见的方法:
.close()关闭资源:记住,所有的资源对象使用完成后都要主动关闭才行
.moveToNext()移动到下一行
.moveToFirst()移动到第一行
.getColumnCount()返回列数
.getColumnIndex("")返回列名称
.getString(.getColumnIndex(""))返回获得列名称对应的数据
if(cursor!=null)
while(cursor.moveToNext()){
String a=cursor.getString(cursor.getColumnIndex("column1"));
int b=cursor.getInt(cursor.getcolumnIndex("column2"));
}
cursor.close();
}
android中cursor对象的使用的更多相关文章
- Android中Cursor类的概念和用法[转]
首页 > 程序开发 > 移动开发 > Android > 正文 Android中Cursor类的概念和用法 2011-09-07 0个评论 收藏 ...
- Android中Cursor(游标)类的概念和用法
使用过 SQLite 数据库的童鞋对 Cursor 应该不陌生,如果你是搞.net 开发你大可以把Cursor理解成 Ado.net 中的数据集合相当于dataReader.今天特地将它单独拿出来谈, ...
- Android中Cursor类的概念和用法
http://blog.sina.com.cn/s/blog_618199e60101fskp.html 使用过 SQLite数据库的童鞋对 Cursor 应该不陌生,加深自己和大家对Android ...
- Android中Parcelabel对象的使用和理解
1. Parcelable接口 Interface for classes whose instances can be written to and restored from a Parcel. ...
- Android中传递对象的三种方法
Android知识.前端.后端以至于产品和设计都有涉猎,想成为全栈工程师的朋友不要错过! Android中,Activity和Fragment之间传递对象,可以通过将对象序列化并存入Bundle或者I ...
- Android中序列化对象到XMl 和 XML反序列化为对象
package com.example.xmloperation; import java.io.File; import java.io.FileOutputStream; import java. ...
- Android中Bitmap对象和字节流之间的相互转换
android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte import java.io.B ...
- Android中Bitmap对象和字节流之间的相互转换(转)
android 将图片内容解析成字节数组:将字节数组转换为ImageView可调用的Bitmap对象:图片缩放:把字节数组保存为一个文件:把Bitmap转Byte import java.io.Buf ...
- Android中WebView的JavaScript代码和本地代码交互的三种方式
一.Android中WebView的漏洞分析最近在开发过程中遇到一个问题,就是WebView使用的时候,还是需要解决之前系统(4.2之前)导致的一个漏洞,虽然现在这个系统版本用户很少了,但是也不能忽视 ...
随机推荐
- ZwQueryVirtualMemory暴力枚举进程模块
0x01 前言 同学问过我进程体中EPROCESS的三条链断了怎么枚举模块,这也是也腾讯面试题.我当时听到也是懵逼的. 后来在网上看到了一些内存暴力枚举的方法ZwQueryVirtualMemory. ...
- 转 【<meta name="description" content=">】作用讲解
今天在看别人写的网站代码,发现类似<meta name="Keywords" content="" >.<meta name="De ...
- Java访问控制权限
在Java中一共存在四种访问控制权限,即 private.default(默认).protected和public 1.private 访问权限 private属于私有访问权限,可以用在属性的定义.方 ...
- Internet Of Things
- Android 笔记之 R 文件
Android笔记之R文件 h2{ color: #4abcde; } a{ color: blue; text-decoration: none; } a:hover{ color: red; te ...
- jar命令使用介绍
http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/jar.html Skip to Content Oracle Technol ...
- 学习spring mvc
http://www.cnblogs.com/bigdataZJ/p/springmvc1.html
- 视频监控——从其他浏览器打开低版本IE方案
1. 方案背景 由于低版本IE浏览器并不支持很多新的页面技术,导致部分页面效果难以实现;另一方面IE浏览器版本与操作系统绑定,难以统一,不同版本IE间的不兼容导致多种兼容性问题,因此本项目暂定采用Ch ...
- WCF 的优势和特点
版权声明:本文为博主原创文章,未经博主允许不得转载. 一.理解面向服务(Service-Oriented-Architecture) 是指为了解决在Internet环境下业务集成的需要,通过连接 ...
- March 1 2017 Week 9 Wednesday
If you are serious giving up something, giving up is not serious at all. 如果你慎重地决定要放弃,那么放弃本身就没什么大不了的. ...