Referencing an XML string in an XML Array (Android)

in arrays.xml

<string-array name="my_items">
  <item>My item 1</item>
  <item>My item 2</item>
  <item>My item 3</item>

in strings.xml

  • How to Work With Different Screen Resolutions
  • API21 setButtonTintList on CheckBox
  • How to retrieve Key Alias and Key Password for signed APK in android studio(migrated from Eclipse)
  • Beginning Programmer Interested in Android - Should I Start with Java?
  • Warning: Exported activity does not require permission
  • Android: How to completely kill a Service running separately as a background process?
  • <resources>
      <string name="item1">My item 1</string>
      <string name="item2">My item 2</string>
      <string name="item3">My item 3</string>

    I would like to reference the string in the array “My item 1” from strings.xml. How do I do that?

    Related posts:

    SQLite database on SD card
    How to implement Android 4.0 like swipe to dismiss functionality in ListView?
    Loop to upload list images one by one
    Loading kernel module in Android kernel
    TextView is not Clickable on OpenGl Curl View Effect
    How do you determine the audio latency (AudioTrack) on Android?
  • if(session.isOpen()), facebook login on android always returning false
  • Notification Not showing
  • http connection timeout issues
  • How to continuously get RSSI without connecting to the BLE device?
  • How to call simple GET method using “Retrofit”
  • Android “No content provider found for permission revoke”
  • 2 Solutions collect form web for “Referencing an XML string in an XML Array (Android)”

    oh yeah, that is what I meant. This is how I did it.

    <string-array name="my_items">

    It resolved correctly in Android 1.6

    You can’t. It might be possible to do the reverse: have @string/item1 in the <string-array>.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.