This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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
 
Saloon Keeper
Posts: 7181
166
  • 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
Saloon Keeper
Posts: 7181
166
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic