list=converCursortoList(cursor);Intentintent=newIntent(Dict.this,show.class);Bundlebundle=newBundle();bundle.putSerializable("list",list);intent.putExtras(bundle);startActivity(intent);}-IMDN开发者社群-imdn.cn"> list=converCursortoList(cursor);Intentintent=newIntent(Dict.this,show.class);Bundlebundle=newBundle();bundle.putSerializable("list",list);intent.putExtras(bundle);startActivity(intent);} - IMDN开发者社群-imdn.cn">
登录
首页 » Android » Android SQLiteOpenHelper 类代码

Android SQLiteOpenHelper 类代码

于 2022-01-26 发布 文件大小:15.89 kB
0 124
下载积分: 2 下载次数: 1

代码说明:

Android SQLiteOpenHelper 类代码,这同样是一个简单级别的SQLite实例,主要教你一些基础的SQLite用法,本源码通过编写一个简单的词汇添加小程序,让你了解如何向SQLLITE中添加词汇,查找词汇,查询的sql语句如何编写,以及如何创建一个SQLSite数据表等。相对简单,编译后的运行效果,请看下边的截图。添加内容和查询内容的代码,如下示:   //添加词汇   addWordBtn.setOnClickListener(new View.OnClickListener() {   @Override   public void onClick(View v) {    inflateInsert(mydb.getReadableDatabase(),wordEdit.getText().toString(),detailEdit.getText().toString());   }   });   //查找词汇   seachWordBtn.setOnClickListener(new View.OnClickListener() {   @Override   public void onClick(View v) {   //查询的sql   String querySql = "select * from mydb where word like ?";   Cursor cursor = mydb.getWritableDatabase().rawQuery(querySql, new String[]{    "%"+seachWordEdit.getText().toString() + "%"   });   ArrayList> list = converCursortoList(cursor);   Intent intent = new Intent(Dict.this, show.class);   Bundle bundle = new Bundle();   bundle.putSerializable("list", list);   intent.putExtras(bundle);   startActivity(intent);   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Project
    gradle 项目的算法总结,包含几种基础算法(The algorithm summary of gradle project, including several basic algorithms)
    2020-06-23 18:00:02下载
    积分:1
  • Android
    2022-07-11 14:49:45下载
    积分:1
  • Android独数游戏源码
    常规的九宫格界面,点击未知数字的区域,弹出包含可能数字的对话框,填完所有数字来完成游戏。项目中使用了自定义的数独界面,通过绘制的方式画出整个游戏界面,提示的数字使用的是自定义的Dialog,项目中有非常详细的注释
    2022-10-13 21:45:03下载
    积分:1
  • SHMYaoActivity
    利用JAVA汇编语言来实现安卓系统中的摇一摇功能( Using the JAVA language to achieve shake shake features in Android )
    2013-06-03 13:39:49下载
    积分:1
  • BaiduMapApiDemo
    百度地图api,有各项功能的demo,详尽、具体,适合初学者探究(Baidu map api, there are various functions of the demo, detailed, specific, suitable for beginners to explore)
    2013-10-23 14:45:55下载
    积分:1
  • android简单控制跳转
    android小案例简单的实现控制跳转   可以拼合其他的部分成为自己的代码!
    2022-05-27 16:36:59下载
    积分:1
  • Android网络课表的获取
    本程序来自课程实践从青果服务器获取网络课表; 本程序可以在Android studio 上运行,SDK为4.2.2
    2023-04-26 22:25:04下载
    积分:1
  • Android UI
    说明:  I will share with you some tips for UI design in Android
    2020-04-26 09:55:34下载
    积分:1
  • 夜间模式 白天模式切换
    夜间模式 白天模式切换
    2015-04-22下载
    积分:1
  • 安卓通讯录
     
    2023-05-08 01:40:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载