I wanna know how to access strings & colors & dimens of xml files programmatically.
Is there any easy way to access it ???
You'll want Resources.
In an activity, you can use getResources() to retrieve that object, and then simply use
Resources res = getResources();
String string = res.getString( R.string.string_id );
int color = res.getColor( R.color.color_id )
etc.
You can use getResource of your activity to get the string, color ,etc from your values folder of your project.
sample:
String m_string = getResources().getString(R.string.app_name); //string xml
float m_dimension = getResources().getDimension(R.dimen.dimension); //dimens xml
int m_color = getResources().getColor(R.color.blue); //color xml
strings.xmlrather than set it?