Code example for RemoteViews

Methods: setInt

0
            updateWidgetForDay(widgetView, arrayViewMatcher.getViewId(i), alarmDays.isSelected(i));
        } 
    } 
 
    private static void updateWidgetForDay(RemoteViews widgetView, int id, boolean isSelected) {
        widgetView.setInt(id, "setTextColor", isSelected ? SELECTED_COLOR : NOT_SELECTED_COLOR);
    } 
 
    private static PendingIntent getOpenConfigIntent(Context context, int widgetID) {
        Intent configIntent = new Intent(context, ConfigActivity.class);
        configIntent.setAction(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
        configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetID);
        return PendingIntent.getActivity(context, widgetID, configIntent, 0);
    } 
 
    private static PendingIntent getOnOffIntent(Context context, int widgetID) {
        Intent onOffIntent = new Intent(context, AlarmWidget.class);
        onOffIntent.setAction(ACTION_CHANGE);
        onOffIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetID);
        return PendingIntent.getBroadcast(context, widgetID, onOffIntent, 0);