The difference between these two methods when displaying the screen?

In BlackBerry development (I'm talking BB OS 6+), if I want to display a different screen when a button is pressed, I've seen that I can use any of the following methods to do this:

getScreen().getUiEngine().pushScreen(new MyScreen());

      

and

UiApplication.getUiApplication.pushScreen(new MyScreen());

      

Both of the above methods show the new MyScreen

screen successfully . But what is the difference between the two? Or are they the same?

Note. I specifically ask the question: do they behave differently (across resources) and do they handle method calls the same way or not. And do they have any noticeable implications for end users?

Thank.

+3


source to share


1 answer


The first method pops the screen onto the stack, associated with the application that "owns" the screen containing the field (I assume you are calling Field.getScreen () ...).

The second method pushes the screen onto the application stack, which "owns" the thread, which executes UiApplication.getUiApplication () ...

Unless you are doing complex background processing or interacting with system applications via ApplicationMenus or some listeners.



The main effect is what resources are available in each case. If you are using app coverage overleons, these differences will ultimately affect your program. This is one of the reasons why RIM recommends using system single-user systems using RuntimeStore or PersistentStore.

My experiences developing a specific program help: http://www.hrbuckley.net/2012/03/blackberrry-singletons-application.html

+4


source







All Articles