App gets Force Close upon running an SQL query-Collection of common programming errors
You should create queries like this:
Cursor c = db.rawQuery("SELECT * FROM sharelist WHERE category=?",
new String[] {category});
This will do the proper quoting for you and save you from SQL injections attacks.
Also, whenever you see a Force Close, there is an unhandled Exception associated with it. You can see that in the LogCat (this is available in Eclipse’s Debug perspective). The type and the message of the Exception are invaluable information for debugging the error.
Originally posted 2013-12-02 20:56:32.