用textView 画圆 更换颜色 动态添加到布局里面
TextView textView = new TextView(mContext);
LayoutParams params = new LayoutParams((int) mContext.getResources().getDimension(R.dimen.color_text_bg),
(int) mContext.getResources().getDimension(R.dimen.color_text_bg));
params.setMargins(7, 5, 0, 0);
textView.setLayoutParams(params);
textView.setBackground(mContext.getResources().getDrawable(R.drawable.textview_style));
GradientDrawable p2 = (GradientDrawable) textView.getBackground();
p2.setColor(Color.parseColor("需要更换的颜色");
动态添加到下面这布局里面
<LinearLayout
android:id="@+id/color_layout"
android:layout_width="fill_parent"
android:layout_marginTop="6dp"
android:layout_height="@dimen/gridview_item_color_layout_height"
android:gravity="center"
android:orientation="horizontal" >
</LinearLayout>
textview_style.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false" >
<solid android:color="#ffffff" />
<stroke
android:width="0.5dp"
android:color="#bbb" />
</shape>