In strings.xml
I have string-array
which populates the spinner
.
I have an note app where user can select subject from spinner and show in recycler view.
So after user added note and if the user clicks the note then it should redirect to that spinner and auto select the subject which is selected previously.
I tried to set position as sub_spinner.setSelection(subPosition)
but I can't figure out how to get the subPosition
String.xml
<string-array name="subject">
<item>Communication English</item>
<item>Computer Graphics</item>
<item>COA</item>
<item>Data Communication</item>
<item>Instrumentation II</item>
<item>Software Engineerinng</item>
</string-array>
So if I have sub as COA then i should get index of 2.