I am creating some android app just for fun (it's not really app it's just like sandbox).
For the first time I use reflection for setting some new value in private field of object of Android SDK class.
It looks like this:
try {
f = obj.getClass().getDeclaredField("<field_name>");
f.setAccessible(true);
f.set(obj, <new_value>);
} catch (Exception e) {
// log
}
I know it's a bad practice for using (and I will change it ASAP), but now it's this way. It works fine on my 3 devices and emulator.
So my question is: In which cases I can not set a new value for existing field?