Tutorial :Change the screen when click on the button



Question:

I am new to Blackberry..I am developing an application which contain the home screen having a button on it. When clicked on it, it is changing to new screen for that I used UiApplication.getUiApplication().pushScreen(new NewScreen()); in the fieldchangedListener method. In the newscreen I added a verticalFieldManager and add some images and a button.What I want is when I click on this button it should takes to the homescreen.

I implemented the second screen functionality in NewScreen class which is in the main class.

Please let me know any suggestions.

Thanks Koushik


Solution:1

i think you want to go back to the previous screen. try this.

Screen currentScreen = UiApplication.getUiApplication().getActiveScreen();                  UiApplication.getUiApplication().popScreen(currentScreen);  


Solution:2

Write this a code snippet, then I can help you. Perhaps You need to overload methods onClose, onSave or etc.


Solution:3

I can use the command close(); in the button event, thus you'll close the second Screen and return to the first one.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »