View state

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi to all. I am coming from Windows programming, and don't know Android very much. Luckily B4a helps in this case. My doubt is the following:
An application is made by several activities (pages), presenting to the user various Views (or Controls, like Buttons, for example). These Views are destroyed and regenerated even just turning the orientation of the telephone. So, if we want to maintain their state, say Enabled/Disabled for example, we must store it in some ProcessGlobals variables (this is the way I have though till now). Now, we have an Activity_Resume event that allows ripristinating the state of the Views in a Page, given the relative Process variables. BUT do we have any event that allows the opposite, i.e. to store the View state in the ProcessGlobal variable? It should be something fired, for example, before the Activity is destroyed and recreated during the orientation change, or something like a KillFocus..
In other words: A button in an activity may be enabled or disabled. Initial state is disabled. User enables it. He turns the telephone. I want that the button stays enabled. In activity_resume I can reassign the Button State to any stored status, but where I can know whether the button is enabled or not, before the activity is destroyed?
Thanks in advance
 
Last edited:

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Answering my question

Sorry, I have just seen that I have ActivityPause that probably allows to manage my situation. So, I guess this the answer to my question.. Thanks anyway
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…