android
-
(Android) NumberPicker with leading zero
Set your number picker to show leading zeros by applying a formatter to it. Example is using an anonymous instance, but of course it doesn’t have to. [java] myNumberPicker.setFormatter(new NumberPicker.Formatter() { @Override public String format(int value) { return String.format("%02d", value); } }); [/java] For %02d this goes: 0 for filling with zeros 2 for length…
-
(Android) Prevent config change on orientation change
Add to activity in manifest:
-
Open weblinks in external browser when using Phonegap
To prevent a Phonegap-wrapped app from opening external links in the apps webview, use javascript to open the link in the external browser. This works on Android (probably other platforms as well)