• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Displaying a list of favourites  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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
 
Saloon Keeper
Posts: 4741
117
  • Mark post as helpful
  • send pies
  • 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
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • 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
  • 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
Saloon Keeper
Posts: 4741
117
  • Mark post as helpful
  • send pies
  • 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
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!