How to set a textview's background color to be holo green light via XML?
android
Solution
Via Java:
TextView test = (TextView) view.findViewById(R.id.textView2);
test.setBackgroundResource(context.getResources().getColor(android.R.color.holo_green_light));
Via XML:
<TextView
android:text="2"
android:textSize="200sp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/textView2"
android:style="@style/textviewStyle"
android:background="@android:color/holo_green_light"
android:gravity="center"
android:textColor="#EEEEEE"
android:layout_alignParentRight="true" />
This is the API page about this topic
Problem
I've got a textview and I'd let to set its background color to be holo green light as mentioned here. However, I can't figure out how to do this via XML. Is it possible? I currently have: ``` <TextView android:text="2" android:textSize="200sp" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/textView2" android:background="#00FF00" android:gravity="center" android:textColor="#EEEEEE" android:layout_alignParentRight="true" /> ``` However, I'm unable to change android:background to somehow reference holo green light. Does anyone have any suggestions? I've tried "@android:color/" but no dice.