是否有可能自动返回到应用程序中调用一个号码后? [英] Is it possible to go back automatically into the application after calling a Number?

查看:144
本文介绍了是否有可能自动返回到应用程序中调用一个号码后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序有一些电话号码,以便用户可以拨打的号码。



当用户点击它推他们出来的应用程序的数量叫他们挖的数量。



我要的是应用程序应该得到用户回之后的谈话到此结束应用程序。



在邮件模式下,你可以使用 MFMailComposeController ,然后再切换回以前的看法。



所以,当你使用MFMailComposeController你永远走不出的应用程序。

 公共覆盖无效viewDidLoad中()
{
base.ViewDidLoad();

//拨打电话< / I>
this.buttonCall.TouchUpInside + = {委托
NSURL URL =新NSURL(电话:0707878039);
如果(UIApplication.SharedApplication.CanOpenUrl(URL))
{
UIApplication.SharedApplication.OpenUrl(URL);
}
,否则
{
Console.WriteLine(无法打开网址:{0},url.AbsoluteString);
}
}



那么,有没有做这件事的方法吗?


解决方案

  this.btnCall.TouchUpInside + = {委托

UIWebView的网页=新的UIWebView();
NSURL URL =新NSURL(电话:07777777777);

web.LoadRequest(新的NSURLRequest(URL));


};

工作正常,但的WebView在(警报)问,如果你真的要拨打的号码或不..



您可以通过电话或取消。



当通话结束后,你将回到查看!



至于MemoDreamer


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?

解决方案

        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

这篇关于是否有可能自动返回到应用程序中调用一个号码后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆