1
단추의 onClick() 메서드로 이루어진 나가는 호출을 잘라낼 때 어떻게 되나요? 나는 대화 상자를 열고있는 곳의 조각이있는 단추가 있습니다. 대화 상자의 버튼 클릭 전화 통화 활동이 여기 을 시작에 내가 몇 가지 코드를 넣어 내 전화 상태 리스너는 친절하게 나에게사용자가 나가는 호출을자를 때 같은 조각으로 돌아갈 수있는 방법
// 전화했다
String temp = "tel:+91"+"xxxxxxxxxx";
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse(temp));
startActivity(callIntent);
// 내 전화 상태 리스너
private class PhoneCallStateListener extends PhoneStateListener
{
private boolean isSystemCalling = false;
public void onCallStateChanged(int state, String incomingNumber) {
if (TelephonyManager.CALL_STATE_OFFHOOK == state)
{
isSystemCalling = true;
}
if (TelephonyManager.CALL_STATE_IDLE == state)
{
if (isSystemCalling)
{
if(!active)
{
db.update_activity(Utilities.CONST_SYS_STATUS,Utilities.STATUS_DEACTIVE);
update();
}
else
{
db.update_activity(Utilities.CONST_SYS_STATUS,Utilities.STATUS_ACTIVE);
update();
}
isSystemCalling = false;
}
}
}
}
도움
예, 제대로 작동하지 않습니다.이 줄 앞에 startActivity (callIntent); 권리 ? –
예, 코드로 이해할 수있는 한 실수였습니다. 어쨌든, 당신의 problem.Keep 코딩을 해결하면 답변을 허용으로 표시 할 수 있습니다 :) @ravi_koriya – Swr7der