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  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

50K ohm B50K Diameter 6mm Shaft potentiometer terminal 6 Double taper N5R3
$0.99
50K ohm B50K Diameter 6mm Shaft potentiometer terminal 6 Double taper N5R3 picture carbon linear variable potentiometer with diameter knob, wth118-2w 10k ohm
$10.72
 carbon linear variable potentiometer with diameter knob, wth118-2w 10k ohm pictureDUNCAN POTENTIOMETER 3253 20 K USED 0315
$10.0
DUNCAN  POTENTIOMETER    3253   20 K    USED      0315 pictureCLAROSTAT POTENTIOMETER JA1N056S253UA/RV4NAYSD253A SEE DESC USED 0315
$10.0
CLAROSTAT   POTENTIOMETER   JA1N056S253UA/RV4NAYSD253A  SEE DESC   USED   0315 pictureBOURNS POTENTIOMETER #3852A-282-104A 100K UNUSED 0315
$5.0
BOURNS  POTENTIOMETER    #3852A-282-104A  100K    UNUSED       0315 picture






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