i\'ve used the following code to repeat the image in the background but its not working can any one help?
Layout.xml
Bitmaps (and their states) get reused a lot, and I've found it's easy to lose the tileMode if a BitmapDrawable is used in more than one place. The following code fixes the problem for me:
public static void fixBackgroundRepeat(View view) {
Drawable bg = view.getBackground();
if(bg != null) {
if(bg instanceof BitmapDrawable) {
BitmapDrawable bmp = (BitmapDrawable) bg;
bmp.mutate(); // make sure that we aren't sharing state anymore
bmp.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
}
}
}