BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-09-2008, 07:13 AM   #1
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question How to close the popup screen?

Please Login to Remove!

I have a popup screen in my application.

when this popup screen is pushed in to the display, if an incoming call comes,

i want to close this pop up screen.

How can we know whether the popup screen is displayed or not , when an incoming call comes? and how can we close it?
Offline  
Old 04-09-2008, 07:19 AM   #2
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

What kind of popupscreen u have..?? Dialog r status.?

You can activate ur application to foreground to show the popupscreen.

From background also it is possible to show popupscreen.

Popup screen have a button and on pressing it, vil close the popup screen.

If you find any difficulties, let me know.
Offline  
Old 04-09-2008, 07:51 AM   #3
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Question

Actually my popup is a dialog with 2 radio buttons...

whenever i get an incoming call i want to close this popup(if the popup is visible) , via code, because there is no button to close it..
Offline  
Old 04-09-2008, 08:38 AM   #4
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

http://www.blackberry.com/knowledgecenterpublic/l ivelink.exe/fetch/2000/348583/800332/800505/800608 /How_To_-_Alert_a_user_from_a_Background_applicati on.html?nodeid=820551&vernum=0

Check this link for bringing the popupscreen from background.

Remove spaces after u paste the link in the URL. spaces are like "%20".
Offline  
Old 04-09-2008, 09:41 AM   #5
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

Actually I don't want to show any popup i have to close existing popup...

I am implementing the phoneListner interface. So whenever i get an incoming call the callIncoming() event will get executed... there i want to check whether the popup is displayed or not, if displayed i have to close it.
Offline  
Old 04-09-2008, 11:55 PM   #6
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

Any Default popup screen appearing.. during incoming call..??
Offline  
Old 04-10-2008, 01:22 AM   #7
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

Suppose, i am doing something in my own application and a popup screen is displayed on the screen (a screen with 2 radio buttons).

then an incoming call comes to my phone, after i accept or reject the call this pop up remains in the screen... So whenever an incoming call comes i want to close the pop up screen...

Suppose in my application i have a main screen and a settings screen. when i open the settings screen, an incoming call comes. then i want to close the settings screen automatically and display the main screen... this is the case..
Offline  
Old 04-10-2008, 01:34 AM   #8
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

Sorry Your fact is not clear.
Offline  
Old 04-10-2008, 02:17 AM   #9
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

I have an application.

whenever you start the application it will come to the main screen.

when i am on this screen if i am getting an incoming call it will show the status in the main screen

my problem is if i open the settings screen, at that time if i get an incoming call i want to show the status in the main screen. for that i have to close the settings screen. how can i do that? (when incoming call comes , if the settings screen is open close settings screen. how can i do this)
Offline  
Old 04-10-2008, 02:33 AM   #10
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

I guess you are using two screen class which extends MainScreen.

Use popupScreen(screen) method in UiApplication class to remove the settings screen from the display.

Use status class to show the status in the main screen.
Offline  
Old 04-10-2008, 03:09 AM   #11
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

if you receive an incoming call the system will push a popup-screen where you can answer or reject the call. do you mean this screen?
or are you pushing your own screen using a phonelistener?
why are you showing a screen that you don't want to be shown, then?
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-10-2008, 04:46 AM   #12
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

I have a main screen and many other screens.

when i am opening the settings screen it comes above the main screen.

suppose the settings screen is open and that time i am getting an incoming call, i have to close that settings screen and come to the main screen.


so whenever i get an incoming call i have to check whether settings screen is open, if then close it... how to check it? is there any method to check it?
Offline  
Old 04-10-2008, 04:46 AM   #13
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

For checking the whether ur settings screen on the top of the stack, use isDisplayed() method.

Note:Please go Through API Doc before doing coding and asking questions.

PS:Dont send private messages for forum relation queries.
Offline  
Old 04-10-2008, 04:57 AM   #14
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

Quote:
Originally Posted by hithayath_sait View Post
PS:Dont send private messages for forum relation queries.
seems that was more of a sweeping strike but a private message as i got one, too.

anyhow, i'll give you some beginner credit points and hope you can buy some netiquette with them

one way to solve it: implement PhoneListener.callIncoming in your option screen and call popscreen then (be aware of the fact that the thread is handled by the phone application and you need to get back to your own or the event thread via invokelater).

you could also implement OptionsProvider to have your applications options handled by RIMs option manager instead of a screen in your own application.

hth,
simon
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-10-2008, 05:44 AM   #15
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

I want to try the first way.. but my problem is i dont have a handle to the specific screen...


ie popScreen (screen) method, what parameter i can pass "screen"
Offline  
Old 04-10-2008, 08:11 AM   #16
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

if you are IN the screen you can use 'this', if you are not you need either a handle or UiApplication.getActiveScreen
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-10-2008, 09:27 AM   #17
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

I declared my screen as onDemandScreen.

then i checked

// will get executed when an incoming call comes

if(onDemandScreen.isDisplayed()){
onDemandScreen.close()
}

but i am getting an exception

java.lang.IllegalStateException: UI engine accessed without holding the event lock.
Offline  
Old 04-10-2008, 11:03 PM   #18
hithayath_sait
Thumbs Must Hurt
 
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 51
Default

Try this code below:

Code:
UiApplication.getUiApplication().invokeLater(new Runnable() {
      public void run() {
             if(onDemandScreen.isDisplayed()){
                       onDemandScreen.close()
              }
      }
});
Offline  
Old 04-11-2008, 12:30 AM   #19
arunk
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Default

I tried this code.. but its giving me an illegal state exception...

when i caught the exception i got the details of exception as:

"UI engine accessed without holding the event lock."

I tried:

UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
synchronized(UiApplication.getEventLock()){
onDemandDialog.close();
}
}
});

but still getting the same exception....
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


New original ATV630D37N4 frequency converter ATV630D37N4 picture

New original ATV630D37N4 frequency converter ATV630D37N4

$2287.20



Signal Frequency Counter LED Display Digital Frequency Counter 0.1MHz~65MHz Blue picture

Signal Frequency Counter LED Display Digital Frequency Counter 0.1MHz~65MHz Blue

$16.81



Single To 3 Phase 7.5KW 10HP 220V Variable Frequency Drive Inverter CNC VFD VSD picture

Single To 3 Phase 7.5KW 10HP 220V Variable Frequency Drive Inverter CNC VFD VSD

$169.90



ABB VFD ACS880-01-240A-5 New 200HP @ 480V Variable Frequency Drive picture

ABB VFD ACS880-01-240A-5 New 200HP @ 480V Variable Frequency Drive

$5000.00



Single To 3 Phase 7.5KW 10HP 220V Variable Frequency Drive Inverter CNC VFD picture

Single To 3 Phase 7.5KW 10HP 220V Variable Frequency Drive Inverter CNC VFD

$151.11



Huanyang VFD 110V 1.5kw 2HP Variable Frequency Drive Inverter Convert 1to3 Phase picture

Huanyang VFD 110V 1.5kw 2HP Variable Frequency Drive Inverter Convert 1to3 Phase

$91.20







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.