I Need real Example of EndCall in Android
<p>my application is working in Background and wait for call
this my problem of EndCall 
 because this method is not work in my Service code
Why !!!!!! ????<br>
how get this method to work
and can i get a real example of this...</p>

<pre><code>public class MyService extends Service {
PhoneStateListener phoneListener =new PhoneStateListener();
     private MyBinder binder=new MyBinder(); 

@Override
     public IBinder onBind(Intent arg0) 
{
    // TODO Auto-generated method stub
    return null;
}

        public class MyBinder extends Binder 
{
    public MyService getInstance()
    { 
        return MyService.this;
    }
}

@Override
  public int onStartCommand(Intent intent, int flags, int startId) 
{  
    Log.d("MyService","Service on OnStartCommand"); 
  return START_STICKY;
}


 @Override
 public void onCreate()
 {
    // TODO Auto-generated method stub
    super.onCreate();
    Log.d("My Service","Service onCreate");
 }

   private class PhoneListener extends PhoneStateListener
{


  @Override
    public void onCallStateChanged(int state, String incomingNumber) 
{
        // TODO Auto-generated method stub  

        if(TelephonyManager.CALL_STATE_RINGING==state)
        {
            Log.d("CallState", "Ringing Call");
        }

        if(TelephonyManager.CALL_STATE_OFFHOOK==state)
        {
                Log.d("CallState", "OffHook Call");
                postData(incomingNumber, GSMvalue, lattitude, Longitude);
        }

        if(TelephonyManager.CALL_STATE_IDLE==state)
        {
            Log.d("CallState", "IDLE Call");
        }
        Log.d("CallState", "inside Call State");
        super.onCallStateChanged(state, incomingNumber);        
}
</code></pre>
