Skip to content Skip to sidebar Skip to footer

Why Am I Getting An Java.lang.illegalargumentexception: The Bind Value At Index 1 Is Null In This Case?

I know what an java.lang.IllegalArgumentException: the bind value at index 1 is null means and what causes the error. I my case I am still unable to find the reason for such an err

Solution 1:

itemName is null in addPurchaseQuantity() invocation and thus why when SQLite tries to use it to replace the selection argument ('?') you receive this exception.

Try setting itemName to a known value and check the results.

EDIT

You should test every method independently so you can easily discover the errors or bugs. Learn to apply unit testing as described in Testing Fundamentals.

Then, you'll discover that the problem is reduced to get the text value from an AutoCompletTextView which you can find plenty of examples out there (i.e. How to get string text from AutoCompleteTextView?).

Solution 2:

I would try removing the sum in : new String[]{"sum(" + VivzHelper.COLUMN_ADD_PURCHASE_ITEM_QUANTITY + ")"}, See if bind works.

Post a Comment for "Why Am I Getting An Java.lang.illegalargumentexception: The Bind Value At Index 1 Is Null In This Case?"