我希望通过广播接收器在呼叫结束后获取最后的呼叫详细信息.我怎么能拿到它?我试过接收器,但是当我接到电话时,呼叫状态是IDEL.我想在呼叫结束或断开连接后获取呼叫详细信息. 最佳答案
public class PhoneStateBroadcastReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
//UDF.createTablesIfNotExists(context);
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(new CustomPhoneStateListener(context), PhoneStateListener.LISTEN_CALL_STATE);
}
}