• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How do I make a functioning save button in Android Studio?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys! I'm trying to make a simple button that will save my data on an application when I use it once more. Google doesn't seem to give me simple tutorials on how to do this. That is why I'm asking here. Also, the language I'm using is Java on Android Studio IDE.
 
Saloon Keeper
Posts: 605
14
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post what you have
 
Saloon Keeper
Posts: 7379
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

On Android (as well as iOS) you generally don't use save buttons - data is saved automatically, usually from the Activity's onPause handler.

There are various ways to store data persistently; which is the most appropriate one depends on the amount of data. For key/value data, shared preferences might work. For regular data, possibly the built-in SQLite database via the Room library. Even files are a possibility, although I would advise against those.
 
reply
    Bookmark Topic Watch Topic
  • New Topic