Hey all,
I am new to BB development. I would like to add a simple dialog box to the screen. Here is my code :
ITRequests.java
Code:
import net.rim.device.api.ui.*;
class ITRequests extends UiApplication {
public static void main(String[] args){
ITRequests myApp = new ITRequests();
myApp.enterEventDispatcher();
}
ITRequests() {
HomeScreen homeScreen = new HomeScreen();
this.pushScreen(homeScreen);
}
}
HomeScreen.java
Code:
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*; // for Dialog class
import net.rim.device.api.system.Bitmap; // for bitmaps
class HomeScreen extends MainScreen {
private Dialog statusDlg;
public HomeScreen() {
super();
// set the title
this.setTitle("IT Requests");
// create a dialog box to notify the user of the tickets being downloaded
Bitmap icon = Bitmap.getBitmapResource("img/download.png");
statusDlg = new Dialog("Downloading Info...",null,null,0,icon);
statusDlg.show();
}
The code compiles and runs fine. However, when I run the app, the first thing I see is a blank screen (with the title set to "IT Requests").
There is no diablog box visible. I was hoping there would be. If I click the back button on my blackberry, then it goes to a blank screen (with no title) and the dialog box appears.
What did i do wrong? I'd like it to appear right away when the app starts (on the same screen as the title).
Thanks!!
Ryan