Code example for SQLiteDatabase

Methods: queryupdate

0
	 
	public int getIdByIdentifier(String identifier){
		db = mSQLHelper.getReadableDatabase();
		String selection = KEY_GOOGLE_TASK_IDENTIFIER + "=?";
		String[] selectionArgs = { identifier };
		Cursor cursor = db.query(TASKS_TABLE_NAME, null,
				selection, selectionArgs, null, null, null);
		int index = cursor.getColumnIndex(KEY_ID);
		if(cursor.getCount() == 0){
			return 0000; 
		}else { 
			cursor.moveToFirst(); 
			return cursor.getInt(index);
		} 
	} 
//	public List<String> getAllTasksTitle(){ 
//		db = mSQLHelper.getReadableDatabase(); 
//		Cursor cursor; 
//		cursor = db.query(TASKS_TABLE_NAME, null, null, 
//					null, null, null, null); 
Contextual code suggestions in your IDE  Get Codota for Java