• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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.
 
Bartender
Posts: 7488
171
  • 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

 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic