File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Store textview color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Store textview color" Watch "Store textview color" New topic

Store textview color

Lex van Rijswijk

Joined: Jul 07, 2012
Posts: 10

I'm pretty new to Android development. Little by little I'm learning heaps of new things. After a few tutorials I'm making a program with al kinds of basic features so I know how to do it myself.

One of the features is changing the color of a textview (mWelcomeUser) by input of the user. When he/she pushes on the "SetColor" button, a dialog shows with different colors. This all works fine untill the orientation changes. I want to safe my color in onPause() and retrieve it in onResume(). The colorsettings are set in color.xml.

So If the user selects purple;

So the color isnt stored as an hex number to a variable. Thats what is giving me a hard time. If it was a hex value I could write that to an int (or a string) variable and retrieve it. But thats not the case here.
What should I do to make this works? It should be something like this (imo):

Thank you,
I agree. Here's the link:
subject: Store textview color
It's not a secret anymore!