首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MonoTouch中的applicationWillBecomeActive

MonoTouch中的applicationWillBecomeActive
EN

Stack Overflow用户
提问于 2012-08-24 00:55:52
回答 1查看 692关注 0票数 0

我正在尝试使用applicationDidBecomeActive方法(以及类似的方法)--我可以在ObjC中找到很多示例,但在Monotouch中一个也找不到。我在AppDelegate和UIViewController中尝试了重写,但编译器找不到合适的方法来重写。那么,我该如何使用它呢?我想使用它(结合计时器和IdleTimerDisabled)来阻止设备进入睡眠状态的时间比平时长(这是一个秒表类型的应用程序)。也许我走错了路。

EN

回答 1

Stack Overflow用户

发布于 2012-08-24 04:42:44

在从UIApplicationDelegate继承的应用程序委托中,您可以覆盖以下内容:

代码语言:javascript
复制
/// <summary>
/// Gets called by iOS if the app is started from scratch and is not resumed from background.
/// We have 17 seconds to leave this methos before iOS will kill the app.
/// </summary>
public override bool FinishedLaunching ( UIApplication application, NSDictionary launchOptions )

/// <summary>
/// Called if the app comes back from background or gets started. Triggered after FinishedLaunching().
/// </summary>
public override void OnActivated ( UIApplication application )

/// <summary>
/// Called if the application gets pushed to the background because the user hits the home button.
/// </summary>
public override void DidEnterBackground ( UIApplication application )

/// <summary>
/// Gets called if the app is resumed from background but NOT if the app starts first time.
/// </summary>
public override void WillEnterForeground ( UIApplication application )
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12096612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档