Java – Android XML layout constants

Android XML layout constants… here is a solution to the problem.

Android XML layout constants

I’m parsing an XML layout file for Android. I want to reference Android’s XML string constants instead of defining my own. I can easily find integer constants, but not XML constants.

Where are these string constants located?


I’m looking for a literal string that references a value, such as android:LinearLayout, android:layout_gravity, android:layout_width and any related value with a value such as match_parent, Properties such as center


Are you talking about getting a string from a string.xml file?

You can get it

String get = this.getResources().getString(R.string.string_name);

Related Problems and Solutions