Code example for ContentValues

Methods: updateput

0
     * @param context the context of the caller. 
     * @param packageName the package of the theme to apply. 
     * @param themeId the id of the theme to apply. 
     */ 
    public static void markAppliedTheme(Context context, String packageName, String themeId) {
        ContentValues values = new ContentValues();
        values.put(ThemeColumns.IS_APPLIED, 0);
        context.getContentResolver().update(ThemeColumns.CONTENT_PLURAL_URI, values, null, null);
        values.put(ThemeColumns.IS_APPLIED, 1);
        context.getContentResolver().update(ThemeColumns.CONTENT_PLURAL_URI, values,
                ThemeColumns.THEME_PACKAGE + " = ? AND " +
                    ThemeColumns.THEME_ID + " = ?",
                new String[] { packageName, themeId });
    } 
 
    /** 
     * Request a theme change by broadcasting to the ThemeManager. Must hold 
     * permission {@link Constants#PERMISSION_CHANGE_THEME}. 
     */ 
    public static void changeTheme(Context context, Uri themeUri) {
        changeTheme(context, new Intent(ThemeManager.ACTION_CHANGE_THEME, themeUri));