Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Secure Financial Transactions with Ansible, Terraform, and OpenSCAP
this week in the
Cloud/Virtualization
forum!
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
Paul Clapham
Jeanne Boyarsky
Bear Bibeault
Sheriffs:
Rob Spoor
Henry Wong
Liutauras Vilda
Saloon Keepers:
Tim Moores
Carey Brown
Stephan van Hulst
Tim Holloway
Piet Souris
Bartenders:
Frits Walraven
Himai Minh
Jj Roberts
Forum:
Android
How to save data from spinner to SQLite?
Malavika Shanker
Greenhorn
Posts: 11
posted 2 weeks ago
Number of slices to send:
Optional 'thank-you' note:
Send
@Override public View getView(int position, View view, ViewGroup viewGroup) { View row = view; ViewHolder holder = new ViewHolder(); if(row==null){ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); row = inflater.inflate(layout,null); holder.spinner= (Spinner) row.findViewById(R.id.spinner); holder.spinner2 = (Spinner) row.findViewById(R.id.spinner2); row.setTag(holder); } else{ holder=(ViewHolder) row.getTag(); } recipe recipe= recipelist.get(position); holder.spinner.setText(recipe.getMeal()); holder.spinner2.setText(recipe.getDifficulty()); return row; } }
The setText doesn't seem to work
(. I am kinda new-ish to
java
Randy Tong
Master Rancher
Posts: 572
9
I like...
posted 2 weeks ago
Number of slices to send:
Optional 'thank-you' note:
Send
Welcome to Ranch
I would suggest you check the value of recipe.getMeal(), maybe it is empty?
Life is but a BREATH
Tim Moores
Saloon Keeper
Posts: 6896
163
posted 2 weeks ago
Number of slices to send:
Optional 'thank-you' note:
Send
Welcome to the Ranch.
What does "doesn't seem to work" mean? What are you expecting to happen, and what happens instead? What are all the values of the relevant variables? What does the spinner have to do with SQLite?
TellTheDetails
Tim Moores
Saloon Keeper
Posts: 6896
163
posted 2 weeks ago
Number of slices to send:
Optional 'thank-you' note:
Send
Continued at
https://coderanch.com/t/740927/mobile/save-data-spinner-SQLite
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to get status of CheckBox in a CustomListAdapter in Android ListView
Get ListView checkbox ID and item ID
listview not displaying contents properly
how to solve arrayindexoutofbound exception
More...