change background color of the layout in Android

Posted by qwerty on Stack Overflow See other posts from Stack Overflow or by qwerty
Published on 2010-05-24T07:16:23Z Indexed on 2010/05/24 7:21 UTC
Read the original article Hit count: 196

Filed under:
|

Hello,

I have a simple Android application, with 3 buttons. When i click on the 1st button, i wanna change the background color of the layout (which is now white... i wanna change in other color, when i press the button). How can i do this?

On that button, i have a myClickHndler event

    public void myClickHandler(View view) {
    switch (view.getId()) {
    case R.id.Button01:
        text.setText("Button 1 was clicked");
        break;
    case R.id.Button03:
        //text.setText("Button 3 was clicked");
                    .................... // ?
        break;
    }
}

Thanks!

© Stack Overflow or respective owner

Related posts about android

Related posts about eclipse