• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Displaying a list of favourites

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to display a list of favourite recipes so once you click on the favourite button it will be added to favourites and a list of favourites will display once favourites is clicked on

Would anyone be able to help me with the coding, I'm only new to coding so am not very great at it and have to make a cooking application for a project in college

Here is some of my code

Home_Screen.java I've not actually added anything for favourites to it yet as I was having trouble with the coding



home_screen.xml



I used a checkbox for the favourite button



recipe.xml



I've been looking around online and I found a few things but don't understand them

Could someone please help me

Thanks in advance
 
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the code doing now, what should it be doing instead, and where are you stuck making the appropriate changes?
 
Bartender
Posts: 598
26
Oracle Notepad Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding items to a list that will also be displayed is usually done via an adapter with a (saved) data source. It's a little complicated, but there are plenty of tutorials online.
 
Jake Jameson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't find any easy to understand examples online Brian Tkatch, I've found a few examples on github but don't understand them, do you have any suggestions?
 
Tim Moores
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might be a good starting point: http://www.vogella.com/tutorials/AndroidListView/articles.html

That site has lots of useful tutorials.
 
Brian Tkatch
Bartender
Posts: 598
26
Oracle Notepad Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, there are so many examples out there and finding the one that's right for you can take a bit of time. Personally, i learned this stuff via Android Essentials, which is available on techtopia here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic