Code example for TelephonyManager

Methods: getCallState

0
        public RockboxTimerTask(RockboxService s, RockboxTimer parent) 
        { 
            super(); 
            timer = parent;
            tm = (TelephonyManager)s.getSystemService(Context.TELEPHONY_SERVICE);
            last_state = tm.getCallState();
        } 
 
        @Override 
        public void run()  
        { 
            timerTask(); 
            int state = tm.getCallState();
            if (state != last_state)
            { 
                switch (state) 
                { 
                    case TelephonyManager.CALL_STATE_IDLE:
                        postCallHungUp(); 
                        break; 
Contextual code suggestions in your IDE  Get Codota for Java