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: 60
Registered: ‎08-20-2009
My Device: Not Specified

Re: Questions about Reminder and SMS feature?

I do keep running my application in the background by following the code even when i exit the app.

 

 

public boolean onClose()
    {
       
        UiApplication.getUiApplication().requestBackground();
       
        return true;
    }

 

 

When i remove the Dialog alert in TimerTask->run() function and just keep a log statement there, it shows the log printed always even when i exit my application too..Why only the Dialog doesn't show up, when outside of my app?

I think, i should do something like below ?

 

 

 

 private class ClickTask extends TimerTask {

 public void run()
        {
            synchronized(Application.getEventLock()){    
                UiEngine ui = Ui.getUiEngine();
                Screen screen = new Dialog(Dialog.D_OK, "Look out!!!", 
                Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
            }
        }
}

 

 

Thank you.

 

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Questions about Reminder and SMS feature?

you can try. Smiley Happy

Developer
Posts: 60
Registered: ‎08-20-2009
My Device: Not Specified

Re: Questions about Reminder and SMS feature?

Hi John,

 

I could be success with the following code finally Smiley Happy !!!  I'll make the app with further modifications based on my requirements..

 

 

public void run()
        {
            UiApplication.getUiApplication().invokeLater(new Runnable() 
            {
                public void run() 
                {
                     UiEngine ui = Ui.getUiEngine();
                     Screen screen = new Dialog(Dialog.D_OK, "Reminder Alert", 
                     Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),Manager.VERTICAL_SCROLL);
                     ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
                }
                });
            
        }

 

 

I should be a lot thankful to you Smiley Happy

 

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Questions about Reminder and SMS feature?

you're welcome. Smiley Happy can you marked this as solved now? Smiley Happy

Developer
Posts: 60
Registered: ‎08-20-2009
My Device: Not Specified

Re: Questions about Reminder and SMS feature?

I already did accepted solution. Does it not in solved state yet?

Highlighted
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Questions about Reminder and SMS feature?

ah. sorry. now it is. Smiley Happy cheers