728x90

 

 

AndroidX이후로 다음과 같이 사용 가능해짐

 

새로운 릴리스 androidx.activity 버전 1.0.0-alpha07

Android 공식 안내서에 대한 추가 설명 : 사용자 정의 뒤로 탐색 제공

public class MyFragment extends Fragment {

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // This callback will only be called when MyFragment is at least Started.
        OnBackPressedCallback callback = new OnBackPressedCallback(true /* enabled by default */) {
            @Override
            public boolean handleOnBackPressed() {
                // Handle the back button event
            }
        });
        requireActivity().getOnBackPressedDispatcher().addCallback(this, callback);

        // The callback can be enabled or disabled here or in handleOnBackPressed()
    }
    ...
}

 

 

 

 

 

Reference

https://www.it-swarm.dev/ko/android/android-%ED%83%90%EC%83%89-%EA%B5%AC%EC%84%B1-%EC%9A%94%EC%86%8C%EC%9D%98-%EB%92%A4%EB%A1%9C-%EB%8B%A8%EC%B6%94-%EC%B2%98%EB%A6%AC/806260360/

728x90
728x90

 

 

1. 참고하면 좋은 블로그

https://www.charlezz.com/?p=354

https://brunch.co.kr/@oemilk/210

https://medium.com/harrythegreat/android-navigation-component-%EA%B0%9C%EB%85%90%EA%B3%BC-%ED%8A%9C%ED%86%A0%EB%A6%AC%EC%96%BC-1-5ac6ac081643

 

 

 

2. 개념 정리

 

 

728x90
728x90

 

1. Analyze -> Run Inspection by Name ... -> Deprecated API usage 실행

 

 

 

728x90
728x90

 

 

 

기존 코드

img_season = (BitmapDrawable)context.getResources().getDrawable(getMap().get(str_season));

 

 

수정 코드

img_season = (BitmapDrawable) ContextCompat.getDrawable(context, getMap().get(str_season));



출처: https://yonoo88.tistory.com/872 [yonoo's]

728x90

+ Recent posts