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: 99
Registered: ‎03-10-2009
My Device: Not Specified

show the screen when a phone call ends

Hi, I want to show a screen after a phone call ends.

 

I have implemented the PhoneLogListener, and in the method callLogAdded(CallLog cl), I put the following code in.

 

 

       //

    public void callLogAdded(CallLog cl){

...

 

 

       Runnable task = new Runnable() {

        public void run() {

 

            UiApplication.getUiApplication().invokeLater(new Runnable() { 

                public void run() {

 

                   UiApplication.getUiApplication().pushScreen(new MyScreen());

 

                }

           });

        }

 

        };

 

       new Thread(task).run();

}

 

the screen shows after the phone ends, but it disappears soon after.

 

how can the screen be there until a user click some button on it ?

 

Thanks,

Jerry


 

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

Re: show the screen when a phone call ends

if you execute code in the phone listener it is executed in the context of the phone application. you have to call invokelater on your application instance (for example) to run code in your own context.
----------------------------------------------------------
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: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: show the screen when a phone call ends

[ Edited ]

Hi wi7up.

 

I agree with simon.

 

Edit: was in edit mode.



"Listen carefully, I shall say this only once"
Developer
Posts: 99
Registered: ‎03-10-2009
My Device: Not Specified

Re: show the screen when a phone call ends

thanks for the replay.

 

Can you show me an simple example ?

Developer
Posts: 99
Registered: ‎03-10-2009
My Device: Not Specified

Re: show the screen when a phone call ends

I just noticed, it is very odd.

 

When I get an incoming call, the window shows and disappears soon, maybe because of the reason mentioned about, I assume.

 

But when I make a phone call, the window shows too, and it can stay there as long as no one closes it.

 

Any one knows why ?

 

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

Re: show the screen when a phone call ends

i guess because the phone application requests background in some cases. and as you show the screen in the phone 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