android - java.lang.IllegalArgumentException: the bind value at index 2 is null -


just wondering few android devices getting below mentioned exception:

caused by: java.lang.illegalargumentexception: bind value @ index 2  null  @ net.sqlcipher.database.sqliteprogram.bindstring(sourcefile:237)  @ net.sqlcipher.database.sqlitedatabase.updatewithonconflict  (sourcefile:1794)  @ net.sqlcipher.database.sqlitedatabase.update(sourcefile:1730)  @ com.sample.android.sqdbhelper.onupgrade(sourcefile:276)  @ net.sqlcipher.database.sqliteopenhelper.getwritabledatabase  (sourcefile:123)  @ com.sample.android.sqdbcontroller.read(sourcefile:431)  @ com.sample.android.ui.mainactivity.oncreate(sourcefile:42)   @ android.app.activity.performcreate(activity.java:5372)  @ android.app.instrumentation.callactivityoncreate  (instrumentation.java:1104)  @ android.app.activitythread.performlaunchactivity  

sample code

contentvalues contentvalues = new contentvalues();  contentvalues.put("col_value1", value1); contentvalues.put("col_value2", value2); contentvalues.put("col_value3", value3); contentvalues.put("col_value4", value4); contentvalues.put("col_value5", value5);  database.insert(data_table, null, contentvalues); 

this true bound value2 coming null value , can handle it. wondering why in of devices didn't observe above exception.

it application activity kill android os, , when reconstruct savedinstancestate, not in right state.

this can happened when user use home button switch app (not until exit app). while app in background, os destroys app activity. once user switch app activity recreated savedinstancestate.

to simulate scenario, can use settings > developer options > check option "don't keep activities", , test app @ screen error occurred using home button, resume app , see can reproduce or not.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -