Get integer value from dimens.xml resource file in Android
问题 I have an EditText which is decimal and I set its length using android:maxLength property in xml: <EditText android:id="@+id/quantity" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" android:singleLine="true" android:maxLength="@integer/quantity_length" /> As its length is going to be used not only in the UI xml file but also in a java class and maybe some other places, I want to avoid problems when I update this