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
Highlighted
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd
Accepted Solution

regarding local notification

hi,
     i have implemented local notification , i have time picker dialog and when the user selects the time from the time picker.., i am showing dialog at the time for local notification and i'm working with 5 os
now intead of showing dailog i want to show a small icon on the home screen as you can see in the screen shot..,

9700-01.png

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: regarding local notification

Try it using PopUp Screen, hope this will help u..
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: regarding local notification

the small icon on the homescreen is an http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/messagelist/ApplicationInd...

i suggest to use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/messagelist/ApplicationInd... to register the indicator and put the result into the RuntimeStore for easy access (to trigger the value or the visibility)
----------------------------------------------------------
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
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding local notification

hi, i have used the following code to register the icon and the icon is displaying on the hoome screen 
now when the user selected time is equal to the phone's current time ,,, for local notification, at that time i'm showing  the small icon on the home screen as i posted the pic in my previous post but the icon on the home screen is showing continiously , how can i remove that icon after the notification
and i more thing is that i'm not closing the app ,, i mean  to say that in the onClose method i'm calling requestbackground() method so that my local notification will work even if the app is closed

ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();    

EncodedImage image = EncodedImage.getEncodedImageResource("Indicator.png");

ApplicationIcon icon = new ApplicationIcon( image );

ApplicationIndicator indicator = reg.register( icon, false, true);
indicator.setIcon(icon);
indicator.setVisible(true);

 

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

Re: regarding local notification

you call setVisible(false) to hide it.
----------------------------------------------------------
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: regarding local notification

"in the onClose method i'm calling requestbackground()"

 

Unless this is the only thing you do, then your app should still close.  Calling this method puts your app in the background.  It does not keep there.  If your app subsequently exits, then the background processing will terminate too.

 

To check that this working as you want, make sure that once your app has been through this, that you can still see your app on the task switcher, i.e. it is still among the list of running applications. 

 

If it is not, then you are probably, perhaps indirectly, invoking other code that will close your application. 

 

Sorry can't help with your notifications question. 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding local notification

when i run the app first time in the constructor ..i'm setting the

ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();    

EncodedImage image = EncodedImage.getEncodedImageResource("Indicator.png");
ApplicationIcon icon = new ApplicationIcon( image );
ApplicationIndicator indicator = reg.register( icon, false, true); indicator.setIcon(icon); indicator.setVisible(false);

 and in my mainscreen when my notification comes.., i mean to say when the time selected by the user ise quals with the phones time at the time i'm using the folowing but the icon is not showing

ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();    

EncodedImage image = EncodedImage.getEncodedImageResource("Indicator.png");

ApplicationIcon icon = new ApplicationIcon( image );

ApplicationIndicator indicator = reg.register( icon, false, true);
indicator.setIcon(icon);
indicator.setVisible(true);

 

 

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

Re: regarding local notification

put it into the runtimestore (or somewhere else) to access it.
creating and registering a new one is not a very good solution.
----------------------------------------------------------
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
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding local notification

actually,i have never worked with runtimestore in BB and what is the benfit of runtimestore
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: regarding local notification

you can access it in different processes.
as you have only one application instance and no background processes you can just reference the indicator in your application.
----------------------------------------------------------
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