Détecter quand le téléphone raccroche
Bonjour
je cherche à détecter quand le téléphone raccroche. Voici le code utilisé :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public void onCallStateChanged(int state, String number){
super.onCallStateChanged(state, number);
switch (state){
case TelephonyManager.CALL_STATE_RINGING:
Toast toast = Toast.makeText(getApplicationContext(),"Sonnerie", Toast.LENGTH_LONG);
toast.show();
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
Toast toast2 = Toast.makeText(getApplicationContext(),"Raccrocher", Toast.LENGTH_LONG);
toast2.show();
break;
}
} |
Quel est la constante pour savoir quand le téléphone raccroche car TelephonyManager.CALL_STATE_OFFHOOK ne fonctionne pas.
Merci d'avance