简体   繁体   English

Ionic 4 android 调用 function 后恢复时应用程序冻结

[英]Ionic 4 android app freeze when resume after call function

I am developing and app which has feature of calling a number.我正在开发具有呼叫号码功能的应用程序。 When i click call button it goes to dial pad and when we cancel it by back button and resumes our app then it freezes and nothing happens wherever we touch on screen.当我单击呼叫按钮时,它会转到拨号盘,当我们通过后退按钮取消它并恢复我们的应用程序时,它会冻结,并且无论我们在屏幕上触摸什么地方都不会发生任何事情。 Below code i have used on call button click.下面的代码我在呼叫按钮点击时使用过。

Method 1:方法一:

window.open('tel:' + this.contactNo, '_system');

Method 2:方法二:

  this.callNumber.callNumber(this.contactNo, true)
      .then( (data) =>
      {
        console.trace("called callnumber ", data);
      })
      .catch( (error) =>
      {
        console.log('Error launching dialer',error);
      });

I have tried both methods but same result.我已经尝试了这两种方法,但结果相同。 Any help.任何帮助。 Thanks in advance提前致谢

so i tried to replicate the issue but don't have any success on doing so.所以我试图复制这个问题,但这样做没有任何成功。

i followed the Ionic Call Number package, Call number From Ionic Framework This were my solution.我遵循了 Ionic Call Number package, Call number From Ionic Framework这是我的解决方案。

Component零件

 async openCallModal(){
    this.callNumber.callNumber("18001010101", true)
        .then(res => console.log('Launched dialer!', res))
        .catch(err => console.log('Error launching dialer', err));
  }

View / HTML查看 / HTML

<ion-content>
  <ion-button (click)="openCallModal()" color="primary">Call</ion-button>
</ion-content>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM