Hi!
Today I have updated my project and Application.Current.Properties dont work correctly. I could save value and read it while my app running, but is i stop and run agarin, Application.Current.Properties is empty. Thank you for help.
Hi!
I had the same issue, it worked fine until the upgrade to Xamarin 4 and Forms 2.
I've solved in this way:
Application myApp = Application.Current;
bool check = myApp.Properties.ContainsKey(key);
Don't know why, but splitting Application.Current.Properties in two parts works!
Stefano
Answers
Hi!
I had the same issue, it worked fine until the upgrade to Xamarin 4 and Forms 2.
I've solved in this way:
Application myApp = Application.Current;
bool check = myApp.Properties.ContainsKey(key);
Don't know why, but splitting Application.Current.Properties in two parts works!
Stefano
Hi!
I have the same issue. The solution of Stefano does NOT work for me, any other ideas? Thanks!
Karsten
Did you try to do forced save?
await Application.Current.SavePropertiesAsync();
I have noticed the same issue. In XF versions prior to 2.0, the settings saved in Application.Current.Properties would survive a swipe up to clear the app from memory. Now they do not. Waiting to hear if this is intentional or not.
Hi everyone. Thank you for the messages. I started to use https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/Settings. It works fine with xf updates and it is simple in use.
Anyone know if this is intentional or a bug in the current version ?
@deandean @karbo @EricSchmitz Are you seeing this on a specific platform (iOS, Android, Windows) or is it common to all platforms?
I noticed it in iOS and did not test the behavior on the Android side. I have since refactored the code to use Montemagno's Settings plugin.
I have this issue too in android platform.It is caused by Xamarin.Android 4.0 but not Forms 2.0
I have this happening on XF2 even on a very fresh app.
Will never find anything. Was working fine before the upgrade.
Test is done launching app from VS on iOS Simulator (Mac), if that's of any help
I had the issue on android, did not test the other platforms.
Going back to Forms 1.5 didn't help, so now I use the settings-plugin from jamesmontemagno. Works fine.
I had to do the same to get Properties to persist - built in mechanism didn't work, used James plugin in the end to get it saving...
We're still looking into this issue, but in the meantime this workaround might address the problem for some applications: https://forums.xamarin.com/discussion/comment/169577/#Comment_169577
I am having the issue in my Xamarin Forms project on Android devices.
I can save and access data in Application.Current.Properties in debug mode but it fails in release mode.
Fails for me in Android Debug as well.
Application.Current.SavePropertiesAsync() not working, gives error missing assembly reference of SavePropertiesAsync, and not saving my data into apllication.cureent.properties [];
any solution?
I ended up having to revert to @JamesMontemagno's settings plugin (didn't feel like writing it myself). Happening on Android when the app is killed and restarted.