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
Contributor
Posts: 21
Registered: ‎03-30-2012
My Device: os6
My Carrier: 9780

how make applocation(which is the Uiapplication invoked) not close

My application type is "Library",  i new one class named "Appinit" extends UiApplication in  my application ,

 

in the Appinit i push a pushGlobalScreen, which is the a PopupScreen .and in the PopupScreen i do this code 

 

 

Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES,
					new MessageArguments(m));
			// m is a TextMessage,which have the Address
			ApplicationManager appMan = ApplicationManager
					.getApplicationManager();
			ApplicationDescriptor current = ApplicationDescriptor
					.currentApplicationDescriptor();

			int i = appMan.getProcessId(current);
			appMan.requestForeground(i);

 

 

 

it can invoke the message list , But when press Escape , this UiApplication named Appinit is colsed,

i try Overrides requestClose(),make return false, but still don't work .

someone tell me how i can do .

 

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how make applocation(which is the Uiapplication invoked) not close

do you close your popupscreen after invoking the mail app?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how make application(which is the UiApplication invoked) not close

Sorry I have a whole load of questions, because to me, the scenario you have described is confusing. 

 

If you have a Library, how do you actually start your UiApplication.  Do you enterEventDispatcher()?  If you are starting a UiApplication, then why are you defining a Library? 

 

When you push the PopupScreen, why are you making it a Global screen?

 

When you run a GlobalScreen, your UiApplication does not run, so therefore there is no interaction between your UiApplication and the PopupScreen.  So I don't think the PopupScreen is closing your UiApplication. 

 

In summary, I am really asking for clarification of this statement:

"But when press Escape , this UiApplication named Appinit is closed"

 

How do you know this is happening?

Contributor
Posts: 21
Registered: ‎03-30-2012
My Device: os6
My Carrier: 9780

Re: how make application(which is the UiApplication invoked) not close

1, I make new thread to open the uiappplication enterEventDispatcher() and when i register my OptionsProvider,

2,popupScreen when i listen the sms coming , why making it a Global screen ,because i want see it anywhere

3,the GlobalScreen codes is in my Uiapplication, i do it in a new thread, but when i finished Invoke message to repaly, next thing is press Escape, then the uiapplication is closed (because i can't listen next incoming sms,if i didn't press Escape it work well)
Contributor
Posts: 21
Registered: ‎03-30-2012
My Device: os6
My Carrier: 9780

Re: how make applocation(which is the Uiapplication invoked) not close

closed,use this code
UiEngine uiEngine = Ui.getUiEngine();
uiEngine.popScreen(this);
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how make application(which is the UiApplication invoked) not close

Sorry some more questions....

 

1) "I make new thread to open the uiappplication enterEventDispatcher()"

 

Really - a new Thread?  Can we see this code?

 

2) popupScreen when i listen the sms coming...

 

How do you listen for an SMS message?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how make application(which is the UiApplication invoked) not close

PM Message sent.