public void onUserInteraction () Since: API Level 3
Called whenever a key, touch, or trackball event is dispatched to the activity. Implement this method if you wish to know that the user has interacted with the device in some way while your activity is running. This callback and onUserLeaveHint()
are intended to help activities manage status bar notifications intelligently; specifically, for helping activities determine the proper time to cancel a notfication.
All calls to your activity’s onUserLeaveHint()
callback will be accompanied by calls to onUserInteraction()
. This ensures that your activity will be told of relevant user activity such as pulling down the notification pane and touching an item there.
Note that this callback will be invoked for the touch down action that begins a touch gesture, but may not be invoked for the touch-moved and touch-up actions that follow.
Activity가 Foreground에서 실행되는 동안 키나 터치가 발생하면 호출. down, pressed, up 마다 호출 되는 것이 아니라 Interaction이 처음 일어난 시점에서만 호출된다.
protected void onUserLeaveHint () Since: API Level 3
Called as part of the activity lifecycle when an activity is about to go into the background as the result of user choice. For example, when the user presses the Home key,onUserLeaveHint()
will be called, but when an incoming phone call causes the in-call Activity to be automatically brought to the foreground, onUserLeaveHint()
will not be called on the activity being interrupted. In cases when it is invoked, this method is called right before the activity’s onPause()
callback.
This callback and onUserInteraction()
are intended to help activities manage status bar notifications intelligently; specifically, for helping activities determine the proper time to cancel a notfication.
Activity가 사용자(예를들어 “뒤로”키나 “홈”키)에 의해 background로 갈때 onPause() 호출 직전에 호출된다. 다른 Activity가 Foreground로 와서 Background로 가는 경우엔 호출안됨.
- 상태표시줄 관리에 유용(사용자가 현재 작동을 취소하고자 하는 경우)
'안드로이드' 카테고리의 다른 글
TextView - SpannableString 2 (0) | 2011.02.08 |
---|---|
TextView - SpannableStringBuilder 를 이용한 스타일 설정 [출처] TextView - SpannableStringBuilder 를 이용한 스타일 설정 |작성자 김동학 (0) | 2011.02.08 |
startActivityForResult() (0) | 2011.02.07 |
RINGTONE_PICKER 호출시 직접 구현한 App 리스트 목록으로 나타내기 (0) | 2011.02.07 |
Conversion to Dalvik format failed with error 2 (0) | 2011.02.07 |