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
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: local notification based on time selected by the user and shoe msg

[ Edited ]

Please start new Threads for new problems. 

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

Re: local notification based on time selected by the user and shoe msg

i have used RealTimeClockListener for local notification but that is working when app is open 

i have to ask one thing that can i use  UiApplication.getUiApplication().requestBackground(); in the onclose method and how can i call clockupdate() method after when app is in Background insted of creating alternate entry point.

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

Re: local notification based on time selected by the user and shoe msg

[ Edited ]

"how can i call clockupdate() method"

 

You don't call this method do you?  The system does it for you.  You know how to do this since you have the answer in one of your Threads:

http://supportforums.blackberry.com/t5/Java-Development/how-to-use-RealtimeClockListener/m-p/2318745

 

And yes - this is an alternative approach (to using an alternate entry and a background application) that should work. 

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

Re: local notification based on time selected by the user and shoe msg


peter_strange wrote:
You know how to do this since you have the answer in one of your Threads

----------------------------------------------------------
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: local notification based on time selected by the user and shoe msg

but i'm not able to get the time which is trigger by realtimeclocklistner in the update mehtod when i close the app

here is my code

public boolean onClose()
{
try {
UiApplication.getUiApplication().requestBackground();
System.out.println("on close called=======");
return true;
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
e.printStackTrace();
}
return super.onClose();

}

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

Re: local notification based on time selected by the user and shoe msg

return super.onClose();

What does this do?

 

If you don't want the system to close your application, then don't call the close method.......

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

Re: local notification based on time selected by the user and shoe msg

yes i'll try to do that not to close the application by system and i can make pop screen which have yes or no button for closing operation and on yes click i'll put my app in background ok that's fine
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: local notification based on time selected by the user and shoe msg

i have used this code to put app in background and now i need to check the time fired by realtimeclocklisteners clockupdate() method in the background plz can u explain me how can i do this
public boolean keyChar(char key, int status, int time) {
//intercept the ESC key - exit the app on its receipt
boolean retval = false;
switch (key) {
case Characters.ESCAPE:
// Dialog.alert("escape");
try {
int response = Dialog.ask(Dialog.D_YES_NO,"Do you want to exit?");
if (response == -1)
{
return true;
}
else
{
UiApplication.getUiApplication().requestBackground();



return false;
}
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("1111111="+e.getMessage());
}

default:
retval = super.keyChar(key,status,time);
}
return retval;
}
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: local notification based on time selected by the user and shoe msg

I don't understand your question.

 

The clockUpdated() method is invoked automatically by the system every minute.  Logically this is the place you wil put your checking code. 

 

Can you please stop posting random bits of code.   

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

Re: local notification based on time selected by the user and shoe msg

yes i agree that clockUpdated() method is fire by system,and i have get the time when app is open
but when i closed the app i have match the time selected by the user to time fire by clockUpdated() in backgroung for notification