Mates i m getting this error message while using sqlite3 native c library (JNI) through NDK
Please suggest me where i m doing wrong
01-29 11:04:19.53
@Manish. I have edited your sample code. Please use cursor.getCount() like this. Thankyou
public ArrayList getDefinations(String query, int column_index)
{
ArrayList words = new ArrayList();
MatrixCursor mcursor = null;
try
{
Stmt stmt = getDB2().prepare(query);
if (stmt.step())
{
//stmt.get_cursor().moveToFirst();
mcursor = stmt.get_cursor();
if(mcursor != null && mcursor.getCount() > 0)
{
try
{
mcursor.moveToFirst();
do
{
words.add(mcursor.getString(column_index));
}
while (mcursor.moveToNext());
}
catch (IndexOutOfBoundsException e)
{
if (MainActivity.logcat_status)
{
Log.e("Error", e + "");
}
}
}
}
}
catch (Exception e)
{
// TODO Auto-generated catch block
if (MainActivity.logcat_status)
{
Log.e("Error", e + "");
}
}
}