Created
June 13, 2014 10:10
-
-
Save akbarsha03/e8d29196c9e64e54c424 to your computer and use it in GitHub Desktop.
Check DB if a record is already exist or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean Exists(String _id) { | |
Cursor cursor = mDb.rawQuery("select 1 from yourTable where _id=?", | |
new String[] { _id }) | |
boolean exists = (cursor.getCount() > 0); | |
cursor.close(); | |
return exists; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment