Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
zinzinzan
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

ApplicationIndicator issue

hi there,

 

i set the ApplicationIndicator.visible(true) when i recive a push the follow code do it 

SingletonNotification notificationSingleton = SingletonNotification.getInstance();								
	SingletonPushInfo snglePushInfo = SingletonPushInfo.getInstance();			
	snglePushInfo.setPush(result);
	notificationSingleton.setVisible(true);

 the first notificationSingleton is stored is the runtime store following this example http://supportforums.blackberry.com/t5/Java-Development/Create-a-singleton-using-the-RuntimeStore/ta...

 

the second singleton is stored in the RuntimeStore too, but only have one list with the push text, the setPush method of that singleton just add in a vector the String of the push msg.

 

then in the main class i check the push singleton msg, to see if the vector is not Empty and then read and remove the push and push a desire screen:

 

final class Main {
	static void main(String[] args) {
		String launch = null;
		if (args != null && args.length > 0) {
			launch = args[0];
		}

		if (launch != null) {
			if (launch.equals("background")) {
				// start the background process
				// this is an auto starting system module entry point
				

			} else if (launch.equals("gui")) {
				SingletonPushInfo sngPushInf = SingletonPushInfo.getInstance();
				UiApp uiApp = UiApp.getInstance();
				
				if (! sngPushInf.isEmpty() ) {
					String strPush = sngPushInf.getLastPush();
					final ParsePush parsePush = new ParsePush(strPush);
					UiApplication.getUiApplication().invokeLater(
						new Runnable() {
							public void run() {
								UiApplication.getUiApplication()
								.pushScreen(new SearchScreen(parsePush.getMessage(),//
								parsePush.getNotificationType()));							                      
								}

							});					
				}

				uiApp.enterEventDispatcher();

			}
		}
	}
}

 

 

well all looks fine when i close the app ( system.Exit(1) ) ,  but when i request to background the app, and new push come, when i press the ApplicationIndicator icon is like if the OS just make a request to foreground, and the code of the main above just dont does anything.

 

where is the bug?? help with this i have triead to solved my self but i cant debug on device becasue look, complicated, have the same version in the device and JDE simulators

 

 

 

Please use plain text.
Developer
zinzinzan
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Re: ApplicationIndicator issue

[ Edited ]

well in summary, i need help when the app is already open and in background, and the ApplicationIndicator is pressed...   help =?  plx :Wacko:

Please use plain text.
Developer
zinzinzan
Posts: 90
Registered: ‎04-03-2012
My Device: 9100
My Carrier: movilnet

Re: ApplicationIndicator issue

i found  this : The alternate entry is going to call the main method with the parameter that is passed in, regardless of whether the application is running.  on this post http://supportforums.blackberry.com/t5/tkb/articleprintpage/tkb-id/java_dev@tkb/article-id/206 but is just bull **bleep**!!!!!  my app still running in background and the main method is not called !!! WTF is happent ??

Please use plain text.