For example, in Java's Locale class documentation it says that Locale.setDefault()
Sets the default locale for this instance of the Java Virtual Machine. This does not affect the host locale.
Since Android OS (aka the host) doesn't use JVM, and instead uses ART to compile Android apps into Dalvik bytecode, it's safe to assume that each Android process is an ART (or DVM?) instance and NOT a JVM instance. That would mean that executing Locale.setDefault() should have no effect whatsoever inside an Android app wouldn't it?
I'm curious because in this stackoverflow post I'm seeing people calling Locale.setDefault()
, and omitting this call seemed to work just fine when I implemented the solutions posted. Am I missing something with how Android works in relation to JVM (or lack thereof)? Why would calling Locale.setDefault(locale) have any affect in an ART instance?
CodePudding user response:
That would mean that executing Locale.setDefault() should have no effect whatsoever inside an Android app wouldn't it?
No.
When you are reading Android JavaDocs for java.*
and javax*
classes, references to the JVM should be interpreted as including Android VMs (whether based on Dalvik or ART).