Hafiz Hafiz - 5 months ago 6
Android Question

Android sqlite update method; java.lang.IllegalStateException: Could not execute method of the activity

I am working on android app. and trying to save some data in sqlite db. I am updating record if I found id or else i am just inserting record. Insertion works fine but update isn't working. Following is method in which I am doing this save work.

public boolean saveSite(View view){
EditText sitename = (EditText) findViewById(R.id.site_name);
EditText login = (EditText) findViewById(R.id.login);
EditText host = (EditText) findViewById(R.id.host);
EditText password = (EditText) findViewById(R.id.password);
RadioGroup grp = (RadioGroup) findViewById(R.id.type);

int selectedID = grp.getCheckedRadioButtonId();
RadioButton type = (RadioButton) findViewById(selectedID);

ContentValues data = new ContentValues();

data.put(DBContract.Site.COLUMN_NAME_SITE_NAME, sitename.getText().toString());
data.put(DBContract.Site.COLUMN_NAME_LOGIN, login.getText().toString());
data.put(DBContract.Site.COLUMN_NAME_HOST, host.getText().toString());
data.put(DBContract.Site.COLUMN_NAME_PASSWORD, password.getText().toString());
data.put(DBContract.Site.COLUMN_NAME_TYPE, type.getText().toString());

long saved = -1;
if(editId == null) {
try {
saved = db.insertOrThrow(DBContract.Site.TABLE_NAME, null, data);
} catch (SQLiteConstraintException ex) {
Toast.makeText(getApplicationContext(),"Site name already exist",Toast.LENGTH_LONG).show();
}
} else {
String[] arr = new String[] {String.valueOf(editId)};

try {
Log.d("data", data.toString());
Log.d("ID", DBContract.Site._ID);
Log.d("table name", DBContract.Site.TABLE_NAME);
Log.d("arr", arr[0]);
saved = db.update(DBContract.Site.TABLE_NAME, data, DBContract.Site._ID + " = ?", arr);
} catch (NullPointerException ex) {
Log.d("Exception", ex.getMessage().toString());
Toast.makeText(getApplicationContext(),"Site name already exist",Toast.LENGTH_LONG).show();
}
}

if( saved != -1) {
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("message", "Connection Saved Successfully");
startActivity(intent);
}

return true;
}


I know you will need log to indentify so here it is:

09-12 21:31:47.464 14132-14430/system_process I/ActivityManager﹕ START {cmp=com.example.hafiz.ftp/.SiteManager (has extras)} from pid 19238
09-12 21:31:47.524 14132-14430/system_process W/WindowManager﹕ Failure taking screenshot for (180x300) to layer 21010
09-12 21:31:48.134 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:48.144 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:48.204 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:48.554 19238-19238/com.example.hafiz.ftp D/Map﹕ {host=host1, type=Active, site_name=teste, _id=1, password=pass, login_name=login1}
09-12 21:31:48.624 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:48.624 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:48.684 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:49.184 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:49.184 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:49.254 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:49.324 19238-19240/com.example.hafiz.ftp D/dalvikvm﹕ GC_CONCURRENT freed 141K, 3% free 9329K/9607K, paused 6ms+6ms
09-12 21:31:49.634 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:49.654 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:49.694 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:50.064 14132-14159/system_process W/ProcessStats﹕ Skipping unknown process pid 19340
09-12 21:31:50.094 14132-14159/system_process W/ProcessStats﹕ Skipping unknown process pid 19342
09-12 21:31:50.154 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:50.154 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:50.184 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:50.234 14132-14269/system_process I/ActivityManager﹕ Displayed com.example.hafiz.ftp/.SiteManager: +2s629ms
09-12 21:31:55.164 19238-19238/com.example.hafiz.ftp D/data﹕ host=host1 type=Passive site_name=tester password=pass login_name=login1
09-12 21:31:55.164 19238-19238/com.example.hafiz.ftp D/ID﹕ _id
09-12 21:31:55.174 19238-19238/com.example.hafiz.ftp D/table name﹕ site
09-12 21:31:55.174 19238-19238/com.example.hafiz.ftp D/arr﹕ 1
09-12 21:31:55.194 19238-19238/com.example.hafiz.ftp D/AndroidRuntime﹕ Shutting down VM
09-12 21:31:55.194 19238-19238/com.example.hafiz.ftp W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2ba041f8)
09-12 21:31:55.254 19238-19238/com.example.hafiz.ftp E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3045)
at android.view.View.performClick(View.java:3512)
at android.view.View$PerformClick.run(View.java:14106)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3040)
            at android.view.View.performClick(View.java:3512)
            at android.view.View$PerformClick.run(View.java:14106)
            at android.os.Handler.handleCallback(Handler.java:605)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4424)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.example.hafiz.ftp.SiteManager.saveSite(SiteManager.java:104)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at android.view.View$1.onClick(View.java:3040)
            at android.view.View.performClick(View.java:3512)
            at android.view.View$PerformClick.run(View.java:14106)
            at android.os.Handler.handleCallback(Handler.java:605)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4424)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
09-12 21:31:55.334 14132-14430/system_process W/ActivityManager﹕ Force finishing activity com.example.hafiz.ftp/.SiteManager
09-12 21:31:55.374 14132-14430/system_process W/WindowManager﹕ Failure taking screenshot for (180x300) to layer 21015
09-12 21:31:55.904 14132-14152/system_process W/ActivityManager﹕ Activity pause timeout for ActivityRecord{2c4b6ba8 com.example.hafiz.ftp/.SiteManager}
09-12 21:31:56.004 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:56.004 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:56.024 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:56.634 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:56.694 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:56.844 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:57.134 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:57.134 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:57.174 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:57.864 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:57.864 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:58.234 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:58.334 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:58.334 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:58.394 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:58.836 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:58.836 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:58.894 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:59.314 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:59.314 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:59.354 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:31:59.854 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:31:59.854 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:31:59.944 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:00.334 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:00.344 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:00.414 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:00.814 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:00.844 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:00.914 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:01.354 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:01.414 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:01.544 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:01.834 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:01.834 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:01.884 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:02.344 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:02.344 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:02.404 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:02.834 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:02.834 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:02.874 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:03.394 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:03.394 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:03.494 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:03.864 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:03.864 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:03.914 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:04.434 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:04.434 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:04.534 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:04.914 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:04.914 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:04.975 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:05.434 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:05.434 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:05.514 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:05.714 14132-14152/system_process W/ActivityManager﹕ Launch timeout has expired, giving up wake lock!
09-12 21:32:05.904 14132-14152/system_process I/Process﹕ Sending signal. PID: 19238 SIG: 3
09-12 21:32:05.904 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 21:32:05.944 19238-19243/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 21:32:06.194 14132-14152/system_process W/ActivityManager﹕ Activity idle timeout for ActivityRecord{2c597e50 com.example.hafiz.ftp/.MainActivity}
09-12 21:33:19.615 14132-14388/system_process W/ThrottleService﹕ unable to find stats for iface rmnet0
09-12 21:33:20.234 14132-14134/system_process D/dalvikvm﹕ GC_CONCURRENT freed 1273K, 14% free 11052K/12807K, paused 27ms+38ms
09-12 21:33:38.534 14396-14400/com.android.phone D/dalvikvm﹕ GC_CONCURRENT freed 430K, 6% free 9484K/10055K, paused 18ms+16ms


So let me know what i am doing wrong. Parameters passed to update method are also in log via
Log.d()
that can be seen right before exception.

----- Update -----



In case I don't handle exception in case of
db.update()
call, log can be like below pasting it here because I think it is more descriptive or detailed and can be helpful.

09-12 22:31:02.715 15108-15108/com.example.hafiz.ftp D/data﹕ host=host1 type=Active site_name=teste password=pass login_name=login1
09-12 22:31:02.724 15108-15108/com.example.hafiz.ftp D/ID﹕ _id
09-12 22:31:02.744 15108-15108/com.example.hafiz.ftp D/table name﹕ site
09-12 22:31:02.744 15108-15108/com.example.hafiz.ftp D/arr﹕ 1
09-12 22:31:02.774 15108-15108/com.example.hafiz.ftp D/AndroidRuntime﹕ Shutting down VM
09-12 22:31:02.774 15108-15108/com.example.hafiz.ftp W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2ba041f8)
09-12 22:31:02.834 15108-15108/com.example.hafiz.ftp E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3045)
at android.view.View.performClick(View.java:3512)
at android.view.View$PerformClick.run(View.java:14106)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3040)
            at android.view.View.performClick(View.java:3512)
            at android.view.View$PerformClick.run(View.java:14106)
            at android.os.Handler.handleCallback(Handler.java:605)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4424)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.database.sqlite.SQLiteStatement.releaseAndUnlock(SQLiteStatement.java:290)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:96)
at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1810)
at android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:1761)
at com.example.hafiz.ftp.SiteManager.saveSite(SiteManager.java:101)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at android.view.View$1.onClick(View.java:3040)
            at android.view.View.performClick(View.java:3512)
            at android.view.View$PerformClick.run(View.java:14106)
            at android.os.Handler.handleCallback(Handler.java:605)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4424)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
09-12 22:31:02.914 14132-14132/system_process W/ActivityManager﹕ Force finishing activity com.example.hafiz.ftp/.SiteManager
09-12 22:31:02.954 14132-14132/system_process W/WindowManager﹕ Failure taking screenshot for (180x300) to layer 21015
09-12 22:31:03.454 14132-14139/system_process I/dalvikvm﹕ Jit: resizing JitTable from 2048 to 4096
09-12 22:31:03.664 14132-14152/system_process W/ActivityManager﹕ Activity pause timeout for ActivityRecord{2c5dc940 com.example.hafiz.ftp/.SiteManager}
09-12 22:31:03.734 14132-14134/system_process D/dalvikvm﹕ GC_CONCURRENT freed 340K, 14% free 11085K/12807K, paused 17ms+29ms
09-12 22:31:03.974 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:03.984 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:04.025 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:04.834 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:04.844 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:04.935 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:05.264 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:05.264 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:05.284 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:05.804 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:05.845 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:05.964 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:06.224 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:06.234 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:06.264 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:06.835 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:06.835 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:06.984 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:07.314 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:07.314 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:07.365 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:07.775 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:07.775 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:07.874 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:08.295 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:08.295 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:08.384 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:08.924 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:08.924 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:09.025 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:09.324 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:09.335 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:09.524 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:09.835 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:09.845 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:09.895 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:10.364 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:10.375 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:10.424 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:10.844 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:10.884 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:10.935 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:10.955 14132-14159/system_process W/ProcessStats﹕ Skipping unknown process pid 15472
09-12 22:31:11.004 14132-14159/system_process W/ProcessStats﹕ Skipping unknown process pid 15474
09-12 22:31:11.406 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:11.406 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:11.494 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:11.857 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:11.857 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:11.895 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:12.404 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:12.404 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:12.494 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:12.864 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:12.864 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:12.926 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:13.024 14132-14152/system_process W/ActivityManager﹕ Launch timeout has expired, giving up wake lock!
09-12 22:31:13.435 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:13.435 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:13.524 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:13.914 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:13.914 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:13.965 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:14.474 14132-14152/system_process I/Process﹕ Sending signal. PID: 15108 SIG: 3
09-12 22:31:14.474 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ threadid=3: reacting to signal 3
09-12 22:31:14.554 15108-15113/com.example.hafiz.ftp I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
09-12 22:31:14.694 14132-14152/system_process W/ActivityManager﹕ Activity idle timeout for ActivityRecord{2c48cd98 com.example.hafiz.ftp/.MainActivity}


See the 'cause' section of log.

Answer

db is null on the line saved = db.update(DBContract.Site.TABLE_NAME, data, DBContract.Site._ID + " = ?", arr);

Edit:

Are you opening and closing the database?

See here: http://stackoverflow.com/a/7999165/1695687

This person is getting the exact same crash at SQLiteStatement.releaseAndUnlock