Code example for SQLiteConstraintException

Methods: getMessage

0
        { 
            database.executeUpdate("delete from theme where _id=?", new Object[] { themeId }); //$NON-NLS-1$
        } 
        catch (SQLiteConstraintException e)
        { 
            Log.e(Constants.PACKAGE, "Couldnot delete theme: " + e.getMessage()); //$NON-NLS-1$
            throw new ThemeProbablyInUseException(); 
        } 
    } 
     
    public Theme getTheme(int themeId) 
    { 
        List<Theme> themes = getAll("where _id=?", new Object[] { themeId }); //$NON-NLS-1$
        if ( themes != null && themes.size() > 0 )
        { 
            if ( themes.size() > 1 ) 
            { 
                Log.w(Constants.PACKAGE, "Too many themes retrieved (themeId=" + themeId + "). Returning the first one."); //$NON-NLS-1$ //$NON-NLS-2$
            } 
            return themes.get(0);
        }