- Hello,
I know RIM is pretty much dead, but I need help with some development. I'm currrently developing an app that pushes data to my device.
I downloaded some code that was supposedly developed by blackberry called the Emergency Contact List.
Here is my issue: The gui isn't popping up when the app runs. I believe that the code is simple enough so that you may help me figure out this issue.
However, here is my short version of the code just so that you can see what I'm doing.
This is the the file that contains main(). The first condition of the if statement just creates a GUI and displays it onto the screen.
Code:/****************************************************************************************** * main() - controls the startup of the application...thread will start in the background * and the GUI starts when user clicks from main menu ******************************************************************************************/ /** * <description> Starts the push data listener intially * @param args <description> */ public static void main(String[] args) { if( args != null && args.length > 0) { ECLApplication theApp = new ECLApplication(); theApp.enterEventDispatcher(); } else { PushedDataListener.waitForSingleton().start(); } }
Code:/****************************************************************************************** * BackGround waitForSingleton() - returns an instance of a listening thread ******************************************************************************************/ public static PushedDataListener waitForSingleton(){ //make sure this is a singleton instance RuntimeStore store = RuntimeStore.getRuntimeStore(); Object o = store.get(RTSID_MY_APP); if (o == null){ store.put(RTSID_MY_APP, new PushedDataListener()); return (PushedDataListener)store.get(RTSID_MY_APP); } else { return (PushedDataListener)o; } }
And now we invoke the start() method.
Code:/****************************************************************************************** * start() - starts the custom listen thread ******************************************************************************************/ public void start(){ invokeLater(new Runnable() { public void run() { myThread.start(); //NotificationsManager.registerSource(ID_1, event, NotificationsConstants.CASUAL);//registring the object event to profiles } }); this.enterEventDispatcher(); // System.out.println("here"); }
Any help would be greatly appreciated. Let me know if I'm missing some information.10-21-11 01:56 PMLike 0 -
- Forum
- BlackBerry Developers
- Developers Lounge
Need help with some codes from blackberry developers
LINK TO POST COPIED TO CLIPBOARD