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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
wu7up
Posts: 99
Registered: ‎03-10-2009

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


 

Please use plain text.
Developer
simon_hain
Posts: 13,830
Registered: ‎07-29-2008
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
Please use plain text.
Developer
myraddin
Posts: 391
Registered: ‎09-12-2008

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"
Please use plain text.
Developer
wu7up
Posts: 99
Registered: ‎03-10-2009

Re: show the screen when a phone call ends

thanks for the replay.

 

Can you show me an simple example ?

Please use plain text.
Developer
wu7up
Posts: 99
Registered: ‎03-10-2009

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 ?

 

Please use plain text.
Developer
simon_hain
Posts: 13,830
Registered: ‎07-29-2008
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
Please use plain text.