You can use the DDMS perspective for achieving this.
Goto DDMS -> Emulator control -> Enter the incoming number you have already saved in the emulator and make a call.
public class PhoneStateListenerActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
PhoneStateListener listener;
TelephonyManager manager;
manager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
listener = new PhoneStateListener(){
public void onCallStateChanged(int state, String incomingNumber) {
String stateString = "N/A";
switch (state) {
case TelephonyManager.CALL_STATE_IDLE:
stateString = "Idle";
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
stateString = "Off Hook";
break;
case TelephonyManager.CALL_STATE_RINGING:
stateString = "Ringing";
break;
时 时
Toast.makeText(PhoneStateListenerActivity.this, stateString, Toast.LENGTH_SHORT)
.show();
时 时
时 时;
manager.listen(listener, PhoneStateListener.LISTEN_CALL_STATE);
时 时
时 时