I want to disable the back button in a fragment class. onBackPressed()
doesn't seem to work in this fragment. How could I disable the back button?
This is my sample code:
public class Login extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
,Bundle savedInstanceState) {
ViewGroup root = (ViewGroup) inflater.inflate(R.layout.login, null);
return root;
}
public void onBackPressed() {
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…