SQLite Cursor return NULL if no record found in Android -


i have problem today retrieving data sqlite. here coding

public cursor fetchdictionary(string searchword) throws sqlexception {     cursor mcursor =         mdb.query(true, database_table, new string[] {key_rowid,                 key_word, key_def}, key_word + "='" + searchword + "'", null,                 null, null, null, null);     if (mcursor != null) {         mcursor.movetofirst();     }     return mcursor; } 

above coding if no record found, android prompt dialogbox , force close. there way return "no record found" error message if no record found?

do try catch, , replace e.printstacktrace() messages.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -