I am trying to display a toast on incoming call and the toast should
disappear on "CALL_STATE_IDLE" but toast continues to appear even after
reaching to idle state,
here is my code:
@Override
public void onCallStateChanged(int state, String incomingNumber) {
Toast toast = new Toast(ctx); // i am passing context here
switch(state){
case TelephonyManager.CALL_STATE_IDLE:
Log.d("DEBUG", "IDLE");
toast.cancel();
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
Log.d("DEBUG", "OFFHOOK");
break;
case TelephonyManager.CALL_STATE_RINGING:
Log.d("DEBUG", "RINGING");
toast.makeText( ctx, "incoming call " ,
Toast.LENGTH_SHORT).show();
break;
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en