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
New Developer
Posts: 4
Registered: ‎01-05-2009
My Device: Not Specified

How to hide the icon of autostartup program in 'Switch application' menu?

Hi everybody!

Please help me solve this problem. I created the program look like the 'notificationdemos' application in Blackberry sample codes. I need some resources must be available first so i push some codes in autostartup as follow:

 

public static void main(String[] args) { if (args.length > 0 && args[0].equals("autostartup")) {

     initAccountConfiguration();

     MessageNotifications mn =
new MessageNotifications();

     mn.registerNotificationObjects();

 

     // Keep this instance around for rendering

     // Notification dialogs.

     mn.enterEventDispatcher();

}

...

}

 

 The program runs well except that when i want to switch to another application, I can see the icon of autostartup program. And if i click on it, the system hangs. I don't want to show this icon. Is there any way to hide it?

Thanks in advance

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: How to hide the icon of autostartup program in 'Switch application' menu?

Does your application has a GUI?
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to hide the icon of autostartup program in 'Switch application' menu?

As mantaker is probably going to suggest, if your application does not have a GUI, then you can extend Application, rather than UiApplication.  However if your application does things that require GUI interaction, such as network connections that may require the 'allow' popup, then this is not an option.  In this case, this Post from Mark Sohm will help.

 

hiding application?

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=14250&query.id=31...

 

To summarize, you can override

 

UiApplication.acceptsForeground()

 

and return false when you don't want your application to be be seen.  Never tried it myself, but don't see why it would not work.