解决方案 »

  1.   

    SQLiteDatabase db = localbook.getWritableDatabase();
    for (int i = 0; i < insertList.size(); i++) {
    try {
    if (insertList.get(i) != null) {
    String s = insertList.get(i).get("parent");
    String s1 = insertList.get(i).get("path");
    String sql1 = "insert into " + "localbook"
    + " (parent,path" + ", type"
    + ",now,ready) values('" + s + "','" + s1
    + "',2,0,null" + ");";
    db.execSQL(sql1);
    }
    } catch (SQLException e) {
    Log.e(TAG, "setApprove SQLException", e);
    } catch (Exception e) {
    Log.e(TAG, "setApprove Exception", e);
    }
    }
    db.close();
    }
      

  2.   

    PS:我的插入语句是写在AsyncTask的doInBackground中的。
      

  3.   

    SQLiteDatabase db = localbook.getWritableDatabase();
    for (int i = 0; i < insertList.size(); i++) {
    try {
    if (insertList.get(i) != null) {
    String s = insertList.get(i).get("parent");
    String s1 = insertList.get(i).get("path");
    String sql1 = "insert into " + "localbook"
    + " (parent,path" + ", type"
    + ",now,ready) values('" + s + "','" + s1
    + "',2,0,null" + ");";
    db.execSQL(sql1);
    }
    } catch (SQLException e) {
    Log.e(TAG, "setApprove SQLException", e);
    } catch (Exception e) {
    Log.e(TAG, "setApprove Exception", e);
    }
    }
    db.close();
    }插入第二张表的代码和这个一样?
      

  4.   

    SQLiteDatabase db = localbook.getWritableDatabase();
    for (int i = 0; i < insertList.size(); i++) {
    try {
    if (insertList.get(i) != null) {
    String s = insertList.get(i).get("parent");
    String s1 = insertList.get(i).get("path");
    String sql1 = "insert into " + "localbook"
    + " (parent,path" + ", type"
    + ",now,ready) values('" + s + "','" + s1
    + "',2,0,null" + ");";
    db.execSQL(sql1);
    }
    } catch (SQLException e) {
    Log.e(TAG, "setApprove SQLException", e);
    } catch (Exception e) {
    Log.e(TAG, "setApprove Exception", e);
    }
    }
    db.close();
    }插入第二张表的代码和这个一样?表名换了呀,是localbook4
      

  5.   

    代码没看出什么问题,你确定localbook4中插入时db.execSQL(sql1);被执行了吗?