Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 5130
135
  • 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: 5130
135
  • 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.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!