我有一个存储位置数据的android应用程序。SQLite数据库中有三组纬度和经度。我想获取一个位置的数据3次并将其存储到数据库中。在我的第一步中,存储位置,位置地址,纬度和经度。第二步,不改变位置和地点的纬度和经度,它将第一数据存储到下一列。
http://i.stack.imgur.com/YRaTL.jpg
您可以在上述图片网址中看到3组纬度和经度。在获得第一个纬度和经度之后,我要在“ latitudey”和“ longitudey”列中添加第二个纬度和经度,然后在“ latitudez”和“ longitudez”列中添加下一个值。我的编码几乎可以,但是在添加第二行时出现问题。第一纬度和经度没有任何错误地保存,但是在第二和第三纬度中复制了较高的值。您可以在以下给定的图中看到它。我该如何解决?我的数据库创建代码如下。我需要在这里做些什么改变?
public static final String DATABASE_NAME = "locationdb.db";
public static final String TABLE_NAME = "locations";
public static final String CCOLUMN_ID = "id";
public static final String COLUMN_LAT = "latitude";
public static final String CCOLUMN_LON = "longitude";
public static final String COLUMN_LAT2="latitudey";
public static final String COLUMN_LON2="longitudey";
public static final String COLUMN_LAT3="latitudez";
public static final String COLUMN_LON3="longitudez";
public static final String COLUMN_LOC = "location";
public static final String COLUMN_PLACE="place";
private HashMap hp;
public SQLiteController(Context context) …Run Code Online (Sandbox Code Playgroud)