Question

J'ai besoin d'appeler une activité lorsque l'état du téléphone vient de la sonnerie au ralenti. Mais ça dit L'intention du constructeur (myphonestatelistener, classe) n'est pas définie. Comment peut appeler l'activité.

    public class MyPhoneStateListener extends PhoneStateListener {
        //static String org="";

        public void onCallStateChanged(int state,String incomingNumber){
              switch(state){
                case TelephonyManager.CALL_STATE_IDLE:
                  Log.d("DEBUG", "IDLE");
                 // MissedCall ms=new MissedCall();

                 Intent missintent=new Intent(this,MissedCall.class);
                 startActivity(missintent);

                break;
                case TelephonyManager.CALL_STATE_OFFHOOK:
                  Log.d("DEBUG", "OFFHOOK");
                break;
                case TelephonyManager.CALL_STATE_RINGING:
                  Log.d("DEBUG", "RINGING");
                break;
                }
              }
    }

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top