Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final LinearLayout linear1 = findViewById(R.id.linear1);
- final Random random = new Random();
- linear1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- int color = Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256));
- linear1.setBackgroundColor(color);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement