오늘은 View와 surfaceView 에 대해 여쭤볼까 합니다.
surfaceView 에서는
surfaceView : http://developer.android.com/reference/android/view/SurfaceView.html
The Surface will be created for you while the SurfaceView's window is visible; you should implement surfaceCreated(SurfaceHolder) and surfaceDestroyed(SurfaceHolder) to discover when the Surface is created and destroyed as the window is shown and hidden.
위와 같이 생성과 소멸시 Created와 Destroyed 메소드를 각각 자동 호출(call back)되게 되는걸로 알고 있습니다.
제가 묻고자 하는 바는
view 클래스에서도 위와 같이 생성과 소멸시 자동으로 호출되는 콜백 함수가 있는지 궁금합니다.
아래의 Focus Handing 이 그와 유사한 기능인지. 유사한 기능이라면 안드로이드의 백버튼(첨부파일에 백버튼 그림 추가)을 눌렀을때 Destroyed 가 호출되는 다른 메소드가 있는지 알고 싶습니다.
설명을 또 어렵게 했네요;;
View : http://developer.android.com/reference/android/view/View.html
Focus Handling
The framework will handle routine focus movement in response to user input. This includes changing the focus as views are removed or hidden, or as new views become available. Views indicate their willingness to take focus through the isFocusable() method. To change whether a view can take focus, call setFocusable(boolean). When in touch mode (see notes below) views indicate whether they still would like focus via isFocusableInTouchMode() and can change this via setFocusableInTouchMode(boolean).
Focus movement is based on an algorithm which finds the nearest neighbor in a given direction. In rare cases, the default algorithm may not match the intended behavior of the developer. In these situations, you can provide explicit overrides by using these XML attributes in the layout file:
nextFocusDown nextFocusLeft nextFocusRight nextFocusUp
SurfaceView의 역할이 궁금합니다. view를 상속받는것은 알겠지만 어떤 역할로 쓰이는지 간단하게나마 설명 부탁드려도 될까요? ^^
항상 감사드립니다.
백버튼(첨부파일)을 눌려 프로그램을 종료한 후 다시 프로그램을 실행하면
앞서 실행한 비트맵 들의 메모리가 없어지지 않고 남아있어서 메모리 충돌이 생깁니다.
때문에 프로그램 실행후 백버튼을 누를시에 Destroy()와 같은 메소드가 호출되어 모든 메모리를 없애줄수 있는 방법이 필요합니다.
다른 방법이 있으시면 답변 부탁드립니다 ^^