Jaywalker
Jaywalker

Reputation: 3119

Blackberry MainScreen Transitions

While writing my first Blackberry application using Java, I am confused between inheriting from MainScreen and Screen classes.

My initial understanding was that there should be just a single MainScreen-derived class in an application, since we would like to define the screen title and other embellishments only once. All the rest of the screens (which are invoked on top of the MainScreen) should derive from Screen.

However, this doesn't seem to be true as I have not been able to get a screen completely cover the non-title area of the previous MainScreen.

Is there anything specific which I have overlooked in understanding how multiple screens in a Blackberry application should be created?

Upvotes: 0

Views: 215

Answers (2)

Nate
Nate

Reputation: 31045

Have you read this on BlackBerry's developer site?

And also this?

I do often have one and only one MainScreen in my application. Other screens can derive from Screen or FullScreen. Whether or not you need every screen to be a MainScreen depends on whether your UI design requires things like the header (title) and footer (status) in each screen, which MainScreen provides.

Are you saying that you're adding other screens, and they simply aren't taking up enough space? If you want additional screens to occupy the full screen, I would subclass FullScreen, not just Screen.

And, you're showing new screens (after the initial MainScreen) with UiApplication.pushScreen() and UiApplication.popScreen()?

Upvotes: 2

Eugen Martynov
Eugen Martynov

Reputation: 20140

Maybe you are confused with classes names MainScreen and Screen. Basically MainScreen extends Screen and adds additional functionality like Menu management, title field, status field and has already VerticalManager on it. If you don't need this functionality, like you have your own better menu functionality, or you need all area for custom draw logic or something else. You have ability to extend Screen class otherwise I suggest you to use MainScreen for every screen in your app.

Upvotes: 3

Related Questions