0
drawable을 해제하고 활동의 수명주기를 관리하는 적절한 방법은 무엇입니까? 일부 메모리 관련 충돌이 나타나기 때문에 비트 맵을 지우려고합니다.onpause에서 배경 drawable 해제
내가 할 :
private static bitmap;
public void onResume() {
view.setBackgroundDrawable(new BitmapDrawable(getResources(),bitmap));
}
public void onPause() {
view.setBackgroundDrawable(null); // What is the best way to do this?
bitmap.recycle();
bitmap=null;
}
logcat에서 스택 추적이 있습니까? – Trinimon
@Andre, 방금 큰 비트 맵으로 레이아웃을 부 풀릴 때 내 앱이 충돌하고있는 것을 보았습니다. 그래서 나는 비트 맵을 정리하고 깨끗하게 유지하는 가장 좋은 방법을 궁금해했습니다. – prostock