PreferenceActivity tutorial - Resetting Preferences

Guardian17

Active Member
Licensed User
Longtime User
In regards to the PreferenceActivity tutorial, after running an App a few times, is there a way to reset the Preferences to the original pristine/unused conditions so that I can test whether the defaults do work properly? If so, is it possible to reset the preferences for an App loaded on a device, and also for the App running on the emulator?

Additionally, where do the preferences get stored? Inside the App .apk? In a separate private file?
 

Guardian17

Active Member
Licensed User
Longtime User
Could not find any files

I generated a sample program to test the preferences and to also use File.ListFiles to see what the preferences file might be.

I've attached a .ZIP file of the program.

The preferences do seem to work properly. Using the debugger, I run the program, access the preferences and change them; exit the program, then re-compile and run the program, and the previously stored/changed preference settings that I had set do appear.

The package name assigned to this program is "my.test.file.list".

When the App runs, the Log of "FileList" only shows:
"FileList = (ArrayList) []"

No file names are shown (usually inside the [brackets] ). Is there something that I'm missing?
 

Attachments

  • TestPrefActivity.zip
    6.5 KB · Views: 154
Upvote 0

Guardian17

Active Member
Licensed User
Longtime User
Sooooooooooo........

So ....... I don't understand. It's obvious that the preferences ARE stored SOMEWHERE, because it remembers the settings from run to run. But if not in "File.DirInternal", then where?? I was expecting a file like "my.test.file.list.ini" to be among the files, but there's nothing at all.

(?????)

(I tried FileList.Size and also got zero).
 
Upvote 0
Top