Is it possible to go back automatically into the application after calling a Number?

半世苍凉 提交于 2019-12-08 06:15:04

问题


In my application I have some phone numbers, so that the users can call the numbers.

When the users tap the numbers it push them out of the application to call the number they tapped.

What I want is that the application should get the users back to the application after that the conversation is finished.

In Mailing mode you can use MFMailComposeController, and then switch back to the previous view.

So When you use the MFMailComposeController You never get out of the application.

  public override void ViewDidLoad ()
     {
        base.ViewDidLoad ();

    //Call A number</i>
    this.buttonCall.TouchUpInside += delegate {
        NSUrl url = new NSUrl ("tel:0707878039");
        if (UIApplication.SharedApplication.CanOpenUrl (url)) 
        {
            UIApplication.SharedApplication.OpenUrl (url);
        } 
        else 
        {
            Console.WriteLine ("Cannot open url: {0}",url.AbsoluteString);
        } 
    }

So is there a way of doing it?


回答1:


        this.btnCall.TouchUpInside+= delegate {

        UIWebView web = new UIWebView();
            NSUrl url = new NSUrl("tel:07777777777");

        web.LoadRequest(new NSUrlRequest(url));


        };

Works fine, but WebView ask in a (Alert) if you really want to dial the number or not..

You Can call or Cancel.

When the call is finished you will get back to the View!

regards MemoDreamer




回答2:


No. You are passing control to an external application (the phone App), and there is currently no way to tell it to switch back to your app.



来源:https://stackoverflow.com/questions/9264065/is-it-possible-to-go-back-automatically-into-the-application-after-calling-a-num

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!