内存不足双更新sqlite android
我是一个初学者,这是我的第一个android应用程序,我遇到了这个问题内存不足双更新sqlite android,android,sqlite,memory,Android,Sqlite,Memory,我是一个初学者,这是我的第一个android应用程序,我遇到了这个问题 Failure 21 "Out of memory" on 0x0 when preparing 'update clients set lat=19.124566,lng=-103.23546 where id=1' 在我的表格结构中,我将lat和lng设置为双精度 我读到这篇文章,有人说SD卡需要更大一些,但后来我把模拟器的SD卡设置为5Gb,我使用的是安卓1.6,希望你能帮我。谢谢你 请在这里输入代码 try
Failure 21 "Out of memory" on 0x0 when preparing 'update clients set lat=19.124566,lng=-103.23546 where id=1'
在我的表格结构中,我将lat和lng设置为双精度
我读到这篇文章,有人说SD卡需要更大一些,但后来我把模拟器的SD卡设置为5Gb,我使用的是安卓1.6,希望你能帮我。谢谢你
请在这里输入代码
try {
dir1 = new Geocoder(this).getFromLocationName(dir_1, 1);
Address address = dir1.get(0);
if(address.hasLatitude() && address.hasLongitude()){
double selectedLat = address.getLatitude();
double selectedLng = address.getLongitude();
adapter.command("UPDATE clientes set lat_1="+selectedLat*1000000+",lng_1="+selectedLng*1000000+" WHERE id="+idCliente);
Log.e("geo","location1: "+selectedLat+" : "+selectedLng);
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e("error","Error en la direccion 1");
e.printStackTrace();
}
此错误消息似乎具有误导性,可能与存储空间或内存无关。这表明当您的SQL中出现错误时,就会发生这种情况
如果没有看到一些代码,就很难给出更具体的建议。你能发布一些吗?所以我猜你的命令方法只是将该字符串放入execSql()方法中。 您需要在要执行的字符串中附加分号,因此:
adapter.command("UPDATE clientes set lat_1="+selectedLat*1000000+",lng_1="+selectedLng*1000000+" WHERE id="+idCliente+";");
我使用sqlite客户端尝试了这个查询,它运行得很好!我会贴些东西!适配器对象的类类型是什么?为什么不使用SQLiteDatabase.update()?见: