Reputation: 120344
What's the scope of System.setProperty in Android?
If I set a property (say System.setProperty("http.keepAlive", "false")
), does it affect all apps in the system, the current app, the current task or the current thread only?
Where is this documented?
Upvotes: 14
Views: 6834
Reputation: 5589
Android Activities of the same application, if you don't specify otherwise in the Manifest.xml, will run in a default Process created for the application when it starts.
Each process runs in its own JVM. So the System.setProperty(), based on @mmccomb 's answer, will reach all Activities in the same Application except if you, on pupose, declare Activities to run in different Processes.
See http://developer.android.com/guide/components/processes-and-threads.html
Upvotes: 0
Reputation: 13807
Java "system" properties do not cross process boundaries, they are held in memory and are tied to a single instance of the virtual machine. Therefore if you set a system property within application it will not be visible to other applications running on the device.
Upvotes: 4