flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saframan <safrei...@outlook.com>
Subject Re: PersistenceManager not loading Data after full restart of APP ( iOS / Android
Date Tue, 14 Jan 2014 09:10:07 GMT
Hey! 
Finally I found the problem. 
It came from my main mxml file ( TabbedViewNavigatorApplication ). There I
created an instance of the PersistenceManager using the variable
declaration. Furthermore, I tried to read some values from the memory using
this PersistenceManager instance. The instance is fine but the “reading”
killed all other savings (randomly, but usually all of them after a couple
of restarts) of the persistence manager from previous app starts. The
persistNavigatorState functionality was not working neither - after every
full restart it started always with the first view.
As soon as I moved the memory access to a handler, for example the
initialize handler, everything became fine. 
Don’t know where it came from. Probably the memory access came too early at
the app start process? 
Here are the code examples: The first one didn’t work and killed all stored
values. The Second was fine! 
BAD: 

<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="320"
persistNavigatorState="true"
initialize="initializeHandler()">
	
	
	
	<fx:Script>
		
		import spark.managers.PersistenceManager;
		public var persistenzManager:PersistenceManager = new
PersistenceManager();
		public var geraeteKlasse:Object = persistenzManager.getProperty("Variable
");
				
		protected function initializeHandler():void
		{
			
			
		……


GOOD: 

<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
 xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="320"
 persistNavigatorState="true"
initialize="initializeHandler()">
	
	
	
	<fx:Script>
		
		import spark.managers.PersistenceManager;
		public var persistenzManager:PersistenceManager = new
PersistenceManager();
		public var geraeteKlasse:Object;
				
		protected function initializeHandler():void
		{
			geraeteKlasse = persistenzManager.getProperty("Variable");




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/PersistenceManager-not-loading-Data-after-full-restart-of-APP-iOS-Android-tp4340p4454.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message