BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-16-2008, 01:26 AM   #1 (permalink)
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
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
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
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re:

simulator of JDE 4.5
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Old 10-16-2008, 04:45 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
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
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

no. i've only JDE 4.5
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Old 10-16-2008, 05:08 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8100
PIN: N/A
Carrier: cellcom
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
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


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





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