I ran the app on the emulator, it’s working fine, but when i install it in the device it crashes.
here’s the code that is responsible for the crash
c1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if ( c1.isChecked() )
{
SQLHandler check = new SQLHandler(StartMoving.this);
check.open();
check.updateTodo(currentMove, "sortandpurge", "Done");
check.close();
}else{
SQLHandler check = new SQLHandler(StartMoving.this);
check.open();
check.updateTodo(currentMove, "sortandpurge", "Not Done");
check.close();
}
}
});
what this code does is that if the checkbox is clicked the database will be updated.
public void updateTodo(String todoMove, String todoName, String todoValue){
ContentValues cv = new ContentValues();
cv.put(todoName, todoValue);
ourDatabase.update(DATABASE_TABLE4, cv, KEY_TODOMOVE + "='" + todoMove + "'", null);
}
but somehow the app crashes in the device but not in the emulator
here’s the log cat
09-27 02:59:05.743: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:05.763: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:08.153: D/dalvikvm(1130): GC_CONCURRENT freed 44K, 2% free 10692K/10823K, paused 11ms+10ms
09-27 02:59:08.213: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:08.343: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:08.724: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:08.853: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:09.223: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:09.353: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:09.403: D/dalvikvm(1130): GC_CONCURRENT freed 13K, 2% free 11222K/11335K, paused 6ms+7ms
09-27 02:59:09.723: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:09.763: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:10.243: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:10.293: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:10.733: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:10.863: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:11.234: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:11.353: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:11.743: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:11.863: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:12.233: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:12.363: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:12.723: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:12.803: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
09-27 02:59:13.233: I/dalvikvm(1130): threadid=3: reacting to signal 3
09-27 02:59:13.363: I/dalvikvm(1130): Wrote stack traces to '/data/anr/traces.txt'
I found the problem, it seems that i set one of the Columns as integer and not as text as it should be, stupid me.