Originally Posted by GermainZ
Well in that case you'd just read the preferences before applying them. In some cases (resources replacements), I don't think it's possible, but if you're hooking a module to change a TextView's color for example:
int textColor = getTextColor(); // load the preference inside the method
TextView textView = …;
textView.setTextColor(textColor); // apply the preference
I might be able to give you an actual example if you explain what you're doing exactly, but as I said I don't think it's possible for resource replacements (which I guess is what you're doing).
When a user has selected a package, a new directory under its package name will be created inside the files dir of my app, and when the user has applied a replacement to a certain resource a new directory will be created inside the directory created a while ago. and then inside this directory is where a new file is created and the filename will be the resource name and the content of the file is just a single line plain text which is the replacement value.
so if you can see it, there is a heirarchy of directories...
under the files dir... it could look like this...
by using this pattern, I can write something that will loop through the files dir... get the package name, then get the resource type, then get the resource name and finally get its value by reading the content. And now we all have the needed arguments to pass to the setReplacement method...
but since you said that it is not applicable to resource replacements, then there's really no hope.
Projects Featured in XDA Portal
- WisdomSky Xploit:
customize statusbar and clock color
theme android without decompiling apks
: Your ROM's OTA update solutions...