Call Control Example Issue on Emulator
<p>I am testing call control example given on: <strong>http://prasanta-paul.blogspot.com/2010/09/call-control-in-android.html</strong> on emultaor.</p>

<p>Code is as below:</p>

<pre><code>package com.example.callblock;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.TelephonyManager;
import android.widget.Toast;

import com.android.internal.telephony.ITelephony;

public class CallBlock  extends BroadcastReceiver{

String[] blockedNumbers = {"5556"};
String incommingNumber;
Context context;
String incomingNumber;
ITelephony telephonyService;

public void onReceive(Context context, Intent intent) {


    //Log.v(TAG, "Incoming Call BroadCast received...");
    //      Log.v(TAG, "Intent: ["+ intent.getAction() +"]");

    Bundle b = intent.getExtras();
    incommingNumber = b.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
    Toast.makeText(context, "Phone no:"+incomingNumber, Toast.LENGTH_LONG).show();
    // Additional Step
    // Check whether this number matches with your defined Block List
    // If yes, Reject the Call
    if(incommingNumber.equals(blockedNumbers[0])){
        try {
            telephonyService.endCall();
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}


   }
</code></pre>

<p>When i tried to run this example ie make call from one emulator(5556) to the second emulator(5554). It shows <strong>Phoneno:null</strong>.</p>

<p>I am unable to understand the reason for this.</p>
