[xamarin form]]Well in native android you have the telephony manager to check what is the state of your device > APP Dev

본문 바로가기
사이트 내 전체검색

APP Dev

[xamarin form]]Well in native android you have the telephony manager t…

페이지 정보

작성자 sbLAB 댓글 0건 조회 126회 작성일 19-10-31 18:35

본문

https://stackoverflow.com/questions/52386242/xamarin-forms-how-to-know-when-a-call-is-currently-taking-place

Well in native android you have the telephony manager to check what is the state of your device:

It has three states:

  • Idle: when it's idle there is no call
  • Offhook: when Off-hook it is in call
  • Ringing: when Ringing

        var telephonyManagerService = (TelephonyManager)Xamarin.Forms.Forms.Context.GetSystemService(TelephonyService);
        var getCurrentState = telephonyManagerService?.CallState;
        switch (getCurrentState)
        {
            case CallState.Idle:
              //No call
                break;
            case CallState.Ringing:
              //Ringing 
                break;
            case CallState.Offhook:
              //On call
                break;
            default:
                break;
        }

댓글목록

등록된 댓글이 없습니다.

회원로그인

접속자집계

오늘
9
어제
29
최대
91
전체
7,629

그누보드5
Copyright © sebom.com All rights reserved.