08-08-2011 08:02 AM
hello all, there is some desiign issue related to screen management.
i hv a tab header in all screens, on click any perticular button one specific screen is pushed. what i want is, to maintain only single instance of any perticular screen. But this gives a problem when user click on any button /tab more than once, multiple instance are created.
somehow i m solving it having static reference to one screen type, and on everyclick i check if it is not null i pop it, but when user returns (hard key return), the reference in not null but so it cannot be poped.
however it is also possible using overriding onClose method
but i m looking for any other, better approach,....................
08-08-2011 08:44 AM
I think you have two choices, though I'm sure other people will think of others,
1) Either maintain and cache a single instance of each screen, so the click does not create an instance, but instead swaps to that instance.
2) Create a new instance of the selected screen and discard the current screen
Either way you manage the swap from one to the next by pushing the new screen and popping the current screen. You can't manage a 'tab using just popping when the screen is closed.
I recommend (1).
08-08-2011 09:37 AM
oh, the same way i m doing , i said if its not null i m poping it,
but also creating the new instance with same reference and pushing it (this way m achiving some sort of caching )
it is ok, but m looking if any better way is there.................