Code example for GridView

Methods: invalidateViews

0
	ColorPickerDialogFragment mFragment = new ColorPickerDialogFragment();
 
	@Override 
	public void onColorSelected(final int color) {
		mCustomizedColor = color;
		mColorsGrid.invalidateViews();
		finishSelecting(color);
	} 
 
	@Override 
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.set_color); 
		mColorsGrid = (GridView) findViewById(R.id.colors_grid);
 
		final Bundle bundle = savedInstanceState != null ? savedInstanceState : getIntent().getExtras();
 
		mCustomizedColor = bundle != null ? bundle.getInt(Accounts.USER_COLOR, Color.WHITE) : Color.WHITE;
 
		final Resources res = getResources();
		mColors.add(res.getColor(R.color.holo_red_dark));