Code example for SQLiteException

Methods: e, getMessage

0
        // Forbidden being instantiated. 
    } 
 
    // FIXME: need to optimize this method. 
    private static boolean isLowMemory(SQLiteException e) {
        return e.getMessage().equals(SQLITE_EXCEPTION_DETAIL_MESSAGE);
    } 
 
    public static void checkSQLiteException(Context context, SQLiteException e) {
        if (isLowMemory(e)) {
            Toast.makeText(context, "Low Memory",
                    Toast.LENGTH_SHORT).show();
        } else { 
            throw e;
        } 
    } 
 
    public static Cursor query(Context context, ContentResolver resolver, Uri uri,
            String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        try { 
            return resolver.query(uri, projection, selection, selectionArgs, sortOrder);
        } catch (SQLiteException e) {
            Log.e(TAG, "Catch a SQLiteException when query: ", e);
            checkSQLiteException(context, e);
            return null; 
        } 
    } 
 
    @SuppressWarnings("deprecation") 
	public static boolean requery(Context context, Cursor cursor) {
        try { 
            return cursor.requery();
        } catch (SQLiteException e) {
            Log.e(TAG, "Catch a SQLiteException when requery: ", e);
            checkSQLiteException(context, e);
            return false; 
        } 
    } 
    public static int update(Context context, ContentResolver resolver, Uri uri,