I am using following code to get version of content
public String getNotificationVersion(String rootContentId) {
String strVersion = "";
try {
database.open();
Cursor cur = database.query(Database.DOWNLOAD_TABLE,
new String[] { Database.KEY_VERSION },
Database.KEY_ROOT_CONTENT_ID + " = ?",
new String[] { rootContentId }, null, null, null);
Log.v("NOTIFICATION PRESENT IN DOWNLOAD GETTING DOWNLOAD", "TRUE");
strVersion = cur.getString(0);
cur.close();
database.close();
} catch (Exception e) {
Log.v("NOTIFICATION PRESENT IN DOWNLOAD GETTING DOWNLOAD", e.getMessage());
// TODO: handle exception
}
return strVersion;
}
and at "strVersion = cur.getString(0);" line I am getting Index -1 requested, with a size of 1 error. I have checked database and there is value for this column. Where I am doing wrong?
Thanks in Advance