mono touch中app进入后台和被唤醒时的监听事件

//当前app被唤醒
            NSNotificationCenter.DefaultCenter.AddObserver (UIApplication.DidBecomeActiveNotification,(notity)=>{
                if (moviePlayerCtrl != null) {
                    //btnPlay.ReloadInputViews();
                    //btnPlay.SetNeedsDisplay();
                    string _url = CurrentCourseTag < 0 ? CourseWebUrl: RelationCourse [CurrentCourseTag, 1];
                    ResetPlayerElement (_url);
                }
            });
            //当前app进入后台
            NSNotificationCenter.DefaultCenter.AddObserver (UIApplication.DidEnterBackgroundNotification,(notity)=>{
                if (moviePlayerCtrl != null) {
                    moviePlayerCtrl.Pause ();
                    if (CCTimer != null) {
                        CCTimer.Invalidate ();
                        CCTimer.Dispose ();
                        CCTimer = null;
                    }
                    PlayerCenter.SetLocalPlaybackProEnd (CourseNumber, CT);
                }
            });

mono touch中app进入后台和被唤醒时的监听事件

上一篇:Android基本功:ContentProvider简介


下一篇:Android利用Gson实现对象和Json数据的相互转换