我正在尝试使用applicationDidBecomeActive方法(以及类似的方法)--我可以在ObjC中找到很多示例,但在Monotouch中一个也找不到。我在AppDelegate和UIViewController中尝试了重写,但编译器找不到合适的方法来重写。那么,我该如何使用它呢?我想使用它(结合计时器和IdleTimerDisabled)来阻止设备进入睡眠状态的时间比平时长(这是一个秒表类型的应用程序)。也许我走错了路。
发布于 2012-08-24 04:42:44
在从UIApplicationDelegate继承的应用程序委托中,您可以覆盖以下内容:
/// <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 )https://stackoverflow.com/questions/12096612
复制相似问题