File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Murach Android Programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Murach Android Programming" Watch "Murach Android Programming" New topic
Author

Murach Android Programming

Willie Smith
Greenhorn

Joined: Nov 19, 2013
Posts: 2
Hi

I don't know if I missed it, but basically this is a question for Joe Murach, or anybody who has the capability to answer this question. I bought the book last week Thursday and I am already up to Chapter 8, in reading. So my question is, with the Tip Calculator App, how can I get the widgets like the SeekBar, Spinner and the Radio Buttons to be set to default values, when a user exits the app by pressing the back button, then clicks the app icon to start the app again. For instance every time I start the app I would want the none radio button selected, no split and 10% to be displayed every time. As it is now, when you exit the app and restart it widgets have selected the previous states that is had before ending the app.


Will
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

Hi Willie, and welcome to CodeRanch!

Wow, you read extremely fast compared to me. It took me weeks to get through chapter 8! Based on my still limited understanding of Android, settings are save and restored via the SharedPreferences class, described on page 106. If you don't want that to happen for some settings, just take out the part where they're saved in the onPause() method and restored in the onResume() method.
Willie Smith
Greenhorn

Joined: Nov 19, 2013
Posts: 2
Thanks Greg,

Ha ha, that makes since, let me look at how they are saved and retrieved, I was pulling my hair out over this, but that makes a lot of since. By the way thanks for the welcome, I have been programming for 10 years with two in Java and Android and some of this is still new to me, but this book is a really good resource.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Murach Android Programming
 
Similar Threads
radio buttons not focusable...continued
Remove message dialog box from Buttons
DestroyApp() and notifydestroy()
deselecting radio button
passing hidden values