Skip to content

Instantly share code, notes, and snippets.

@danielwilson1702
Created September 5, 2015 11:55
Show Gist options
  • Save danielwilson1702/50cc823435e63023d73f to your computer and use it in GitHub Desktop.
Save danielwilson1702/50cc823435e63023d73f to your computer and use it in GitHub Desktop.
A base fragment with onBackPressed()
public class BaseFragment extends Fragment implements OnBackPressed {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
public void onBackPressed() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment