0

I have a weird problem in my program. I need to click the preference menu before the defaults value are activated. This is not good... How can you make the preference default value activated when the program starts and not when you click on the settings menu? Is there to load the values automatically without clicking the preference menu?

The One
  • 1,085
  • 6
  • 13
  • 25

1 Answers1

0

you can use this in oncreate() method...

VAT_STRING = preferences.getString("TAXVAT", "5");
Abhishek Patel
  • 4,280
  • 1
  • 24
  • 38
  • I know how to get the value of the preference. My problem is that the default values are not loaded or activated. Anyway, I found this code.. it worked on the oncreate() method. PreferenceManager.setDefaultValues(this, R.xml.preference, false); – The One Nov 06 '13 at 06:18