1、java
1)字符串
String mystr=activity.getString(R.string.test_string);
textView.setText(simpleString);
2)尺寸
float dimen=activity.getResouces().getDimension(R.dimen.mysize_in_pixels);
3)图像资源
BitmapDrawable d=acitivity.getResouces().getDrawable(R.drawable.sample_image);
4)色图资源
ColorDrawble redDrawable=(ColorDrawble) activity.getResources().getDrawable(R.drawable.redrectangle);
2、xml
1)字符串
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAlign="center"
android:text="@string/tagged_string"/>
2)尺寸
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/mediu_szie"/>
3)图像资源
adroid:background="@drawable/sample_image"
4)色图资源
android:background="@drawable/red_rectangle"