BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 10-02-2008, 12:17 PM   #1 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8800
PIN: N/A
Carrier: At&T
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default deregister phonelistener

Please Login to Remove!

I'm trying to deregister my phone listener when the user selects a radiobutton (one says on, one says off). Can anyone help me? Do I really need to use a runtimestore to grab the phonelistener? Thanks in advance for your help!


Code:
private class FieldListener implements FieldChangeListener {

  public void fieldChanged(Field field, int context) {

    if( context != FieldChangeListener.PROGRAMMATIC) // Perform action if user changed field.
    {      
    int testrb = 0; 
    //"ON"
    if( field == rbf1) 
    {   
      testrb=testrb;
      Dialog.alert(" It's now on! "); 
    }    
    else if(field == rbf2)
    {   
      testrb=testrb;  
      Dialog.alert(" It's off!!! "); 
 
      RuntimeStore store = RuntimeStore.getRuntimeStore();

      // get() throws a ControlledAccessException if your application does not have readaccess to the specified object.
      try {
      // get() returns the objectm with the specified ID if it exists; null otherwise.
      Object obj = store.get(0x60ac754bc0817248L);
      AreaCodeLookup obj2 = (AreaCodeLookup) obj;
      Phone.removePhoneListener(obj2);
      } catch(ControlledAccessException e) {
      // Handle exception.
      //test99 = test99;
      }

Last edited by wojc0008 : 10-02-2008 at 12:20 PM.
Offline  
Old 10-14-2008, 12:45 PM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8800
PIN: N/A
Carrier: At&T
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Fixed it

Accidentally was starting two phonelisteners and only removing one of them! Oops!
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

VINTAGE APPLE MOUSEPAD II IIC IIE MAC MACINTOSH 1984 1985 RETRO
$9.99
VINTAGE APPLE MOUSEPAD II IIC IIE MAC MACINTOSH 1984 1985 RETRO pictureRare Vintage '77 AMI S6820 Purple Ceramic 40 Pin Chip Apple
$99.99
Rare Vintage '77 AMI S6820 Purple Ceramic 40 Pin Chip Apple pictureVtg MEAD Cambridge APPLE Computer Personal Day Planner Desk Agenda/Organizer 90s
$25.0
Vtg MEAD Cambridge APPLE Computer Personal Day Planner Desk Agenda/Organizer 90s pictureWalkman vintage retro Awesome Mix vol 1 cases for samsung LG iphone etc
$22.0
Walkman vintage retro Awesome Mix vol 1 cases for samsung LG iphone etc pictureWalkman vintage retro Awesome Mix vol 1 cases for samsung LG iphone etc
$22.0
Walkman vintage retro Awesome Mix vol 1 cases for samsung LG iphone etc picture






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