BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-16-2008, 01:26 AM   #1
jeet.bhatt@spec-india.com
Knows Where the Search Button Is
 
jeet.bhatt@spec-india.com's Avatar
 
Join Date: Aug 2008
Location: India
Model: 8100
PIN: N/A
Carrier: Vodafone - India
Posts: 25
Exclamation Call Initiated event generated twice !!!!

Please Login to Remove!

hi all,

in my app, i've registered a phone listener
on outgoing call, callInitiated event is generated twice..very strange !!
while on incoming call, callIncoming event is generated once..which is proper

here i've put the code of my phoneListener class

Code:
package com.spec.bb.callreminder.controller;

import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneCall;
import net.rim.blackberry.api.phone.phonelogs.PhoneCallLogID;
import net.rim.blackberry.api.phone.AbstractPhoneListener;

import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.Ui;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.UiEngine;
import net.rim.device.api.system.Bitmap;


public class AddPhoneListener  extends AbstractPhoneListener {
    
    static public void registerOnStartup(){
        AddPhoneListener phone_handler = new AddPhoneListener();
        Phone.addPhoneListener(phone_handler);
        
    }
    
    public AddPhoneListener() {
        util = new UtilityClass(); 
    }
    
    private void checkCall(String ehandler, int callid){
        
        System.out.println("------------------------------>Status:::" + ehandler );
        PhoneCall callInfo = Phone.getCall(callid);
        //ONLY FOR INCOMING/OUTGOING CALL
        if(ehandler.equals("callIncoming") || ehandler.equals("callInitiated")){
            if ( callInfo != null ) {
                System.out.println("------------------------------>Calling:::" + callInfo.getDisplayPhoneNumber());
                    }
                }
            }    
        }
    }
    
    //IMPLEMENTED LISTENER METHODS
    
    // A call has been added to a conference call
    public void callAdded(int callId)
    {  }
    
    // User answered a call
    public void callAnswered(int callId)
    {  }
    
    // Conference call established
    public void callConferenceCallEstablished(int callId)
    {  }
    
    // Network indicates a connected event
    public void callConnected(int callId)
    {  }
    
    // Direct-connect call connected
    public void callDirectConnectConnected(int callId)
    {  }
    
    // Direct-connect call disconnected
    public void callDirectConnectDisconnected(int callId)
    {  }
    
    // Call disconnected
    public void callDisconnected(int callId)
    {  }
    
    // User ended call
    public void callEndedByUser(int callId)
    {  }
    
    // Call has been placed on "hold"
    public void callHeld(int callId)
    {  }
    
    // New call has arrived
    public void callIncoming(int callId)
    { checkCall("callIncoming", callId); }
    
    // Outbound call initiated by the handheld
    public void callInitiated(int callid)
    { checkCall("callInitiated", callid); }
    
    // Call removed from a conference call
    public void callRemoved(int callId)
    {  }
    
    // Call taken off of "hold"
    public void callResumed(int callId)
    {  }
    
    // Call is waiting
    public void callWaiting(int callid)
    {  }
    
    // Conference call has been terminated
    // (all members disconnected)
    public void conferenceCallDisconnected(int callId)
    {  }
    
    // Call failed
    public void callFailed(int callId, int reason)
    {  }
}

any Idea/suggestions???
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Old 10-16-2008, 04:24 AM   #2
sunnan
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Default

which device ur using and could you let me the version ...coz am very sure during outgoing call "call callinitiated" event gets invoked only one time.....
Offline  
Old 10-16-2008, 04:40 AM   #3
jeet.bhatt@spec-india.com
Knows Where the Search Button Is
 
jeet.bhatt@spec-india.com's Avatar
 
Join Date: Aug 2008
Location: India
Model: 8100
PIN: N/A
Carrier: Vodafone - India
Posts: 25
Default Re:

simulator of JDE 4.5
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Old 10-16-2008, 04:45 AM   #4
sunnan
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Default

How about this issue in jde 4.2 and 4.3...have you checked this before..
Offline  
Old 10-16-2008, 04:57 AM   #5
jeet.bhatt@spec-india.com
Knows Where the Search Button Is
 
jeet.bhatt@spec-india.com's Avatar
 
Join Date: Aug 2008
Location: India
Model: 8100
PIN: N/A
Carrier: Vodafone - India
Posts: 25
Default

no. i've only JDE 4.5
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Old 10-16-2008, 05:08 AM   #6
sunnan
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Default

i have worked in this phonelistener before ..so i can confirm you that this callinitiate event gets invoked only one time while making outgoing call....also i couldnt figure out any prob in ur code too...jus try removing checkcall method and jus use those "system.out(........" in each event seperatly..it may work .......
Offline  
Old 04-05-2009, 04:21 AM   #7
qapp
New Member
 
Join Date: Apr 2009
Model: 8100
PIN: N/A
Carrier: cellcom
Posts: 4
Default Ho can I create & throw event?

erased!

Last edited by qapp; 04-05-2009 at 04:22 AM.. Reason: OOPS.. I entered this thread here by mistake! sorry
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


OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5 picture

OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5

$13.81



DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X  - Made By DELL picture

DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X - Made By DELL

$39.98



NEW VESA ADAPTER PLATE FOR DELL E-SERIES MONITORS - OEM picture

NEW VESA ADAPTER PLATE FOR DELL E-SERIES MONITORS - OEM

$6.00



Dell OEM Latitude Rugged Extreme 7404 Left and Right Mouse Buttons 00008 picture

Dell OEM Latitude Rugged Extreme 7404 Left and Right Mouse Buttons 00008

$5.95



Genuine OEM Dell 2375 B2375dnf B2375dfw 110V Fuser fixing N41P2 sku 724-BBCI picture

Genuine OEM Dell 2375 B2375dnf B2375dfw 110V Fuser fixing N41P2 sku 724-BBCI

$94.99



NEW DELL OEM REPLACEMENT PROJECTOR LAMP FOR 4220 4320 GENUINE ORIGINAL  picture

NEW DELL OEM REPLACEMENT PROJECTOR LAMP FOR 4220 4320 GENUINE ORIGINAL

$198.22







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