BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-18-2007, 08:34 AM   #1 (permalink)
New Member
 
Join Date: Apr 2007
Model: 7290
PIN: N/A
Carrier: Cinngular
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Confirmation dialog when Close application

Please Login to Remove!

Sometimes "close" is pressed accidentally - is it possible to make "Confirmation dialog" when user chooses "close" item in menu of application?

What API I should use?
Offline  
Old 06-19-2007, 10:46 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2007
Model: 8700
PIN: N/A
Carrier: O2
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello there,

Of course it is possible. Add a method to any classes that display something on the screen where you want to 'interupt' the close option like this :

PHP Code:
public boolean onClose(){
      
      
int iDialog.ask(Dialog.D_YES_NO,"Are you sure you want to quit !");
       if(
i>&& i!=-){
       
System.exit(0);
        return 
true;
    }
      return 
false
    } 
The Dialog Class is in net.rim.device.api.ui.component.*

Sorry if I've used wrong/incomplete terminology. I'm not a Java developer but have 'inherited' an application that I'm trying to fix up and it does exactly what you're looking for. As far as I can tell, this is how they achieve it

Hope this helps!
Offline  
Old 06-20-2007, 05:28 AM   #3 (permalink)
New Member
 
Join Date: Apr 2007
Model: 7290
PIN: N/A
Carrier: Cinngular
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for replying, but the main trouble is that I don't know how to catch event of choosing "close" item in native menu of blackberry application...
Offline  
Old 06-21-2007, 02:13 AM   #4 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
IF you have over riden the onClose method in your application the system automatically handles that method.. You dont need to catch any close event..
Offline  
Old 06-21-2007, 07:11 AM   #5 (permalink)
New Member
 
Join Date: Apr 2007
Model: 7290
PIN: N/A
Carrier: Cinngular
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Thanks.

(it is net.rim.device.api.ui.Screen.onClose() for future...)
Offline  




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