Code example for BitmapDrawable

Methods: setTileModeXY

0
	public static void fixActionBarBackground(final ActionBar ab,
			final Resources r, final int bg, final int bgSplit) {
		// This is a workaround for http://b.android.com/15340 from 
		// http://stackoverflow.com/a/5852198/132047 
		BitmapDrawable d = (BitmapDrawable) r.getDrawable(bg);
		d.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
		ab.setBackgroundDrawable(d);
		if (bgSplit >= 0) {
			d = (BitmapDrawable) r.getDrawable(bgSplit);
			d.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
			ab.setSplitBackgroundDrawable(d);
		} 
	} 
}