set this code in your buttons onTouch() method (while action down)
Random rand = new Random();
button.setBackgroundColor(Color.rgb(rand.nextInt(255),rand.nextInt(255),rand.nextInt(255));
--
You received this message because you are subscribed to the Google
Groups "Android Developers" gro
well I wasnt sure exactly on how to make a random color to come up.
all i knew how to do was make a designated color work but not let the
app have a free choice.
On Aug 2, 7:34 pm, TreKing wrote:
> On Tue, Aug 2, 2011 at 2:11 PM, CaRRtel Industres <
>
> carrtelindustr...@gmail.com> wrote:
> > I a
thank you, i am attempting your solution at the moment. do i need to
implement anything into the "android:onClick=" command?
On Aug 3, 2:07 pm, Abhishek Akhani wrote:
> set this code in your buttons onTouch() method (while action down)
>
> Random rand = new Random();
> button.setBackgroundColor
>do i need to
> implement anything into the "android:onClick=" command?
Yes; and if you want to target the LinearLayout instead of the Button,
the previous example needs to be modified slightly.
Instead of setting the Color.rgb(r, g, b) for Button.setBackground;
instead do that to the LinearLayou
4 matches
Mail list logo