0

In android studio I am trying to create a college app that will contain different screens containing information. I have created a drawer but am unable to add items to the drawer because of the following line of code:

mApplicationOptions = getResources().getStringArray(R.array.application_options);

everything else works in my program except the array part under array I get the error cannot find symbol variable array. How can I resolve this in order to use the array to populate the list in my navigation drawer.

Thanks!

YoungHobbit
  • 13,254
  • 9
  • 50
  • 73

1 Answers1

0

Did you define the array in your app's resources ? You can do so by declaring an array in strings.xml, for example :

<string-array name="application_options">
    <item>one</item>
    <item>two</item>
    <item>three</item>
</string-array>

Documentation HERE.

I hope this helps, captain ;)

2Dee
  • 8,609
  • 7
  • 42
  • 53