zoukankan      html  css  js  c++  java
  • SQLite(二)

    对应的Activity代码:

    public class SqLiteDemoActivity extends Activity {

        private Button btn1=null;

        private Button btn2=null;

        private Button btn3=null;

        private Button btn4=null;

        private Button btn5=null;

        private Button btn6=null;

        private TextView datatxt=null;

        /** Called when the activity is first created. */

        @Override

        public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);

            setContentView(R.layout.main);

            btn1=(Button)findViewById(R.id.btn);

            btn1.setOnClickListener(new OnClickListener(){

               public void onClick(View v) {

                  // TODO Auto-generated method stub

                  System.out.println("the db is create");              

                  SqlHelper db=new SqlHelper(SqLiteDemoActivity.this, "myhome.db");

                   db.getWritableDatabase();

                   Toast.makeText(SqLiteDemoActivity.this, "db", Toast.LENGTH_LONG).show();

               }

            

            });   

            btn2=(Button)findViewById(R.id.btn2);

            btn2.setOnClickListener(new OnClickListener(){

               public void onClick(View v) {

                  // TODO Auto-generated method stub

                  SqlHelper db=new SqlHelper(SqLiteDemoActivity.this, "myhome.db",3);

                   db.getWritableDatabase();

                   System.out.println("db is update");

                   db.close();

               }

            

            });

            

  • 相关阅读:
    python多线程http压力测试脚本
    php随机生成国内ip
    HTTP请求方式中8种请求方法(简单介绍)
    PHP函数
    jquery获取span标签下的第一个span子标签内容
    php实现数据库备份导出成sql
    php实现备份数据库
    中文繁体简体问题
    编程素养Day009
    编程素养Day008
  • 原文地址:https://www.cnblogs.com/itfenqing/p/4429527.html
Copyright © 2011-2022 走看看