zoukankan      html  css  js  c++  java
  • 【团队】 冲刺一(9/10)

    昨天所做:实现主页面的长按删除操作

    代码是冲刺完才粘的,可能会和所说的有所不同

     //删除账单
        public void delete(int id)
        {
            Log.i("delete","删除开始 id= "+id);
            String whereClause = "_id=?";
            String[] args = {String.valueOf(id)};
            mDB.delete(TABLE_NAME, whereClause, args);
            Log.i("delete","删除成功");
    
        }
     private void showDeleteDialog(final int position)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle("提示");
            builder.setMessage("您确定要删除该条记录吗?");
            builder.setPositiveButton("确定",new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    db.delete(billlist.get(position).getId());
                    /*
                    int isOK = db.delete(billlist.get(position).getId());
                    if (isOK>0) {
                        Toast.makeText(MainActivity.this, "删除成功", Toast.LENGTH_LONG).show();
                    } else {
                        Toast.makeText(MainActivity.this, "删除失败", Toast.LENGTH_LONG).show();
                    }*/
                    Toast.makeText(MainActivity.this, "删除成功", Toast.LENGTH_LONG).show();
                    dialog.dismiss();
                    message = mHandler.obtainMessage();
                    message.what=1;
                    message.arg1=0;
                    message.obj="倒计时:";
                    mHandler.sendMessage(message);
    
                }
            });
            builder.setNegativeButton("取消",new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });
            builder.create().show();
        }

    今天将做:添加“帮助”等到导航栏,并添加它们的点击时间

    遇到问题:

    mDB.delete(TABLE_NAME,"id=?",args);

    中"id=?"报错

    后发现因修改过建表语句,SQLite中是_id而不是id

    数据删除后没有刷新

    添加语句

  • 相关阅读:
    lr11_Analysis_Options选项介绍:
    lr11_Controller_Options选项介绍:
    ArcGIS Python 文件扩展名过滤器设置
    arcgis python xlstoshp
    arcgis python 标注
    ArcGIS Python 唯一值专题
    arcpy 获得是否为布局mxd.activeView
    python 度分秒转度
    我的新书,ArcGIS从0到1,京东接受预定,有160个视频,851分钟
    python 数字转字符保留几位小数 by gisoracle
  • 原文地址:https://www.cnblogs.com/gothic-death/p/10933391.html
Copyright © 2011-2022 走看看