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


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black) picture

BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black)

$36.06



Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030 picture

Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030

$27.44



BLACK+DECKER dustbuster AdvancedClean Cordless Handheld Vacuum picture

BLACK+DECKER dustbuster AdvancedClean Cordless Handheld Vacuum

$49.99



Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.  picture

Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.

$192.00



3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit picture

3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit

$49.30



Commercial Vacuum Sealer Machine Chamber Food Saver Bag Packing Sealing 110V picture

Commercial Vacuum Sealer Machine Chamber Food Saver Bag Packing Sealing 110V

$270.89







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