从浏览器返回应用程序 [英] Return Back To Application From Browser

查看:206
本文介绍了从浏览器返回应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过按键触控(在iPhone中)实施网站通话,因此在这种情况下我的浏览器会被调用并且网站会被打开。

I'm implementing a website call on button touch(in iPhone), so my browser get called in that case and website get opened.

我正在使用以下代码:

- (IBAction) websiteButtonTouched{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
}

现在我想要的是从浏览器回到我的应用程序因为在iPhone4.0和Up中,应用程序仍然在后台运行,我们只需要在浏览器时调用它...

Now what I want is to COME BACK TO MY APPLICATION FROM BROWSER as In iPhone4.0 and Up the application remain running at background we only have to call that when browser quite...

在此先感谢..: P

Thanks In Advance.. :P

推荐答案

请看这个问题:

i电话 - 从网页打开应用程序

至于返回到你离开的应用程序 - 如果设备支持后台(iOS4 +)并且你的后台应用程序没有卸载(由于内存不足),应用程序将返回你离开它的点。

As for returning to application where you left off -- if the device supports backgrounding (iOS4+) and your backgrounded app wasn't unloaded (due to memory shortage), the app will return the point you left it.

但是,如果设备不支持后台处理,或者因内存不足而卸载应用程序,您还必须自己处理应用程序中返回正确点的问题:您可以通过存储有关当前st的信息来实现退出之前应用程序的使用情况。

However, you also have to handle the returning to correct point in app yourself, in the cases that the device doesn't support backgrounding, or app was unloaded due to memory shortage: you can do this by storing information about current state of the app before it exits.

此网页有一些非常好的流程图,描述应用程序背景和前景化等。:

This web page has some very nice flow charts which describe app backgrounding and foregrounding etc.:

http:// www.cocoanetics.com/2010/07/understanding-ios-4-backgrounding-and-delegate-messaging

这篇关于从浏览器返回应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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