android - I want to use random colors for background with smooth transition effect in loop -
my problem instead of getting random colors @ background getting 2 colors animation effect background. , when restart app 2 color changes. goal there must random colors use background smooth animation of color change here's code public class mainactivity extends appcompatactivity { int color1,color2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final relativelayout targetview = (relativelayout) findviewbyid(r.id.new2); backgroundpainter backgroundpainter = new backgroundpainter(); color1=getrandcolor(); color2=getrandcolor(); backgroundpainter.animate(targetview, color1, color2); // int color1 = contextcompat.getcolor(this, r.color.coloraccent); //int color2 = contextcompat.getcolor(this, r.color.colorprimary); } public int getrandcolor(){ random rand = new random(); int r = rand.nexti...