• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

R.string.xxx returns int values on Items' titles of listview

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have multiple listviews on the MainActivity. I created many Arrays to inflate listviews items,and these arrays get the elements from strings.xml, but it appears as int values on the listviews items.
 
Saloon Keeper
Posts: 7592
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm can't really picture what the problem is. Please post relevant short excerpts of the XML and the code that illustrate the problem (you can also attach a screenshot of the device if that helps).
 
Abdelaziz Mahmoud
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

      final Integer[] achieveGoalsTitles = {R.string.createList1, R.string.cleanEnvironment1, R.string.avoidDistractions1, R.string.earlyMorning1
           , R.string.useWeekends1, R.string.neverProcrastinate1, R.string.findSupport1, R.string.beFutureOne1, R.string.checkProgress1,
           R.string.motivateYourself1};


       list1.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1,achieveGoalsTitles));


when I run  the app , it shows me the listview items as int values . the problem always be in the last code "achieveGoalsTitles" which is the name of the array above

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic