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
Trusted Contributor
chamarts
Posts: 108
Registered: ‎01-18-2012
My Device: 9360
Accepted Solution

New Message (Notification) List Handler

Hi,

 

I have a requirement I am setting a notification alert on receiving an email from partner. so whenever the user clicks on the notification preview text, I show him a email screen with information and I take him to the home screen after the email view screen. But however certain things are nto going right with this approach and its functioning little wierd. Pls. look at the code I have and any quick replies are highly appreciated. 

 

net.rim.blackberry.api.homescreen.HomeScreen.setNewState(false);
UiApplication uiApplication = UiApplication.getUiApplication();
uiApplication.pushScreen(new MsgScreen());
uiApplication.requestForeground();

 


 

thx & rgds, 

srinivas chamarthi

Trusted Contributor
chamarts
Posts: 108
Registered: ‎01-18-2012
My Device: 9360

Re: New Message (Notification) List Handler

let me explain the problems.... first thing... it is not setting off the asterix around the application icon.

 

second thing, when I click on the notification, I tend to see series of screens whcih were supposed to popup when I open the messages. 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: New Message (Notification) List Handler

where do you execute this code?
did you extend the messagelistdemo?
----------------------------------------------------------
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
Trusted Contributor
chamarts
Posts: 108
Registered: ‎01-18-2012
My Device: 9360

Re: New Message (Notification) List Handler

yes... I extended the demo...

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: New Message (Notification) List Handler

if your application is already running you can notify it using a global event.
otherwise use applicationmanager to launch it (if needed with an alternate entry point), you can then notify it with the global event (or use the aep to hand over the object).
----------------------------------------------------------
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
Trusted Contributor
chamarts
Posts: 108
Registered: ‎01-18-2012
My Device: 9360

Re: New Message (Notification) List Handler

let me try with global events but wonder what is wrong with the above code  ?  and why it doen't work. 

Trusted Contributor
chamarts
Posts: 108
Registered: ‎01-18-2012
My Device: 9360

Re: New Message (Notification) List Handler

it worked with global event. thanks 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: New Message (Notification) List Handler

to give you a quick explaination:
the message handler runs in the context of the message application.
if you call getUiApplication you don't get your own application.

In many cases it is better to get into the context of the own application, for example by using global events, other examples would be the phonelistener or applicationmenuitems.
----------------------------------------------------------
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
Trusted Contributor
chamarts
Posts: 108
Registered: ‎01-18-2012
My Device: 9360

Re: New Message (Notification) List Handler

yep... thats what I thought... thanks for clarification.... will u be there at bb jam 10 ? 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: New Message (Notification) List Handler

yes, i'll be at bb 10 jam in orlando, but i'll be a total novice there as it is all about bb 10, and i am currently more of a bb java expert.
----------------------------------------------------------
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