Titanium.App.Properties.getString doesn't return default on Android
SDK 1.6, Titanium 1.2.1, Android
var defaultZipcode = Titanium.App.Properties.getString("defaultZipcode", "20500");
after this, 'defaultZipcode' is null, not "20500"
Am I missing something?
1 Answer
-
Accepted Answer
Check your code to see if anywhere you may have set defaultZipcode to an empty string. If so, the getString() method will return that instead of the default. One way to check:
if ( Ti.App.Properties.hasProperty( "defaultZipcode" ) { Ti.Api.info( 'Removing previous default zipcode property' ); Ti.App.Prooperties.removeProperty( "defaultZipcode" ); } Ti.Api.info( Ti.App.Properties.getString( "defaultZipcode", "20500" ));