Is there such a method call \"getBackgroundColor\" in TextView? if I got 2 textViews: tv1 and tv2 in one LinearLayout. What I did:tv1.setBackgroundColor(Color.BLUE)
Setting a background color sets a Drawable with that specified color as the background, i.e. the following example will work just fine:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.some_layout_name);
TextView t1 = (TextView) findViewById(R.id.text1);
TextView t2 = (TextView) findViewById(R.id.text2);
t1.setBackgroundColor(Color.GREEN);
t2.setBackgroundDrawable(t1.getBackground());
}