在Android 7.0中通话录音而不是支持?

在Android 7.0中通话录音而不是支持?,第1张

概述问题是呼叫记录工作正常到Android版本6.0.1但它在Android版本之上不能正常工作. 问题: – 通话开启1分钟,但录音在2到3秒内停止. 这里联系的Edittext: edt_attempt_contact.setOnTouchListener(new View.OnTouchListener() { @Override public boolean o

问题是呼叫记录工作正常到AndroID版本6.0.1但它在AndroID版本之上不能正常工作.

问题: – 通话开启1分钟,但录音在2到3秒内停止.

这里联系的Edittext:

edt_attempt_contact.setontouchListener(new VIEw.OntouchListener() {        @OverrIDe        public boolean ontouch(VIEw v,MotionEvent event) {            final int DRAWABLE_RIGHT = 2;            if (event.getAction() == MotionEvent.ACTION_UP) {                if (event.getX() >= (edt_attempt_contact.getRight() - edt_attempt_contact.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().wIDth())) {                    if (!edt_attempt_contact.getText().toString().isEmpty()) {                        Intent i = new Intent(Intent.ACTION_CALL,Uri.parse("tel:" + edt_attempt_contact.getText().toString()));                        try {                            startActivity(i);                        }catch (SecurityException s){                            s.printstacktrace();                        }                        try {                            audioRecord();                        } catch (IOException e) {                            e.printstacktrace();                        }                    } else {                        Toast.makeText(MainActivity.this,"Attempt Contact Number is required to call",Toast.LENGTH_SHORT).show();                    }                    return true;                }            }            return false;        }    });}

以下是呼叫记录的主要代码.

private voID audioRecord() throws IOException {    MediaRecorder recorder = new MediaRecorder();    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);    recorder.setoutputFormat(MediaRecorder.OutputFormat.MPEG_4);    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);    recorder.setoutputfile(root + "/"            .concat("_")            .concat(generateUniquefilename())            .concat(".amr"));    try {        recorder.prepare();    } catch (IllegalStateException e) {        e.printstacktrace();    } catch (IOException e) {        e.printstacktrace();    }    recorder.start();}

我已经采取了所有需要权限的AndroID录音仍然它不能在上面的androID 6.0.1版本.感谢你提前解决方案…

解决方法 您在服务或活动中使用通话录音代码吗?

呼叫记录开始后,活动填写停止,因此如果您的代码处于活动状态,呼叫记录将停止.

总结

以上是内存溢出为你收集整理的在Android 7.0中通话录音而不是支持?全部内容,希望文章能够帮你解决在Android 7.0中通话录音而不是支持?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1124000.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存