SQLite: Cannot bind argument at index 1 because the index is out of range. The statement has 0 parameters

The selection should be an expression and selectionArgs should have as many elements as there are ? literal placeholders in selection.

Your selection is not an expression and does not have any ? but you have one element in selectionArgs.

You probably want something like:

String selection =  PlayerEntry.COLUMN_NAME_PLAYER_NAME + "=?";

to make it an expression that matches the player name column agains the literal you're binding in selectionArgs[0].

Tags:

Sqlite

Android