Given the strings.xml posted belwo, how to get the identifier of the string given its value? in other words, let assume we have the View posted below, we can get the value set to the Button as follows:
mBtnDecisionAccepted = (Button) findViewById(R.id.actMain_btn_yes);
mBtnDecisionAccepted.getText().toString()
But is there any method which can return the identifier of the string which is
decision_accepted
layout:
<Button
android:id="@+id/actMain_btn_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/decision_accepted" />
strings.xml:
<resources>
<string name="app_name">Test-TraverseThroughAView-1</string>
<string name="decision_accepted">eng: yes</string>
<string name="decision_rejected">eng: no</string>
<string name="decision_postponed">eng: change</string>
</resources>