Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save manishpatelgt/889e4ee45809e92fb5684021186a1258 to your computer and use it in GitHub Desktop.
Save manishpatelgt/889e4ee45809e92fb5684021186a1258 to your computer and use it in GitHub Desktop.
// This method will return if your table exist a field or not
public boolean isFieldExist(SQLiteDatabase db,String tableName, String fieldName)
{
Cursor res= db.rawQuery("SELECT * FROM " + tableName + " LIMIT 0", null);
if (res.getColumnIndex(fieldName) != -1)
return true;
else
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment