I set textview background equal transparent, and now I want change it’s background in code.
when click on mybtn (this is a button) change textview background, how do it?
code:
Button btn = (Button) findViewById(R.id.btn_dialog);
btn.setBackgroundColor(color.transparent);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
TextView txt = (TextView) findViewById(R.id.txt);
txt.setBackgroundColor(??????);
Toast.makeText(getBaseContext(), "this test is ok!", Toast.LENGTH_SHORT).show();
}
});
You can set any color using this:
or