Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Store textview color  RSS feed

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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,
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!