I have a question regarding the Java language: in android
i tried changing a System.property X inside process A, then activating process B
(i thought maybe it’s initializing all the System.properties again)
(process B didn’t see the changed System.property X as expected),
then i resumed the first process and saw that the changed System.property is still there.
I know that the System class can’t be instantiated. since this is the case,
i thought that it will be shared among all the processes.
yet this is not the case.
i understand why we want this to happen, but how can this be if System class is not instantiated? what mechanism in Java causes this behavior?
thanks for the help
While the
Systemclass bytecode is shared among Dalvik VM processes, any singleton data that might be held by theSystemclass (or any other Android OS Java class) is not shared among Dalvik VM processes. Rather, such objects are instantiated on the local process’ heap, no different than any other objects.