what does onBackPress call in a Fragment
问题 In a Fragment i have this: onPause(){ super.onPause(); if(flag){ getActivity.finish(); }else{ } } onResume(){ flag = true; super.onResume(); } and there is a Button, on click i set this flag to false: Button.onClick{ flag = false; } The idea is: when the button is clicked don't finish this Activity. But when device BackButton is pressed finish(). But this logic isn't working. The reason is, when i press BackButton of the device, onPause is not being called. This is the 4th Fragment in the