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();

               }

            

            });

            

  • 相关阅读:
    pagination分页插件使用
    ajax实现图片文件上传和图片预览
    屏幕护眼色调调节
    css画三角形以及实现带三角的阴影效果
    软件测试homework3
    使用Junit包进行单元测试并导入eclemma包。
    软件测试homework2
    软件测试homework1 编程过程的一个小错误
    ReentrantLock
    Elasticsearch-基本概念
  • 原文地址:https://www.cnblogs.com/itfenqing/p/4429527.html
Copyright © 2011-2022 走看看