Android Development Tips – Ep #1 – Creating Base Fragment

Welcome to the very first episode of Android Development Tips. Today we will learn why and how of “Creating a Base Fragment”. For every project you must create a base class for your activities and fragments. Watch this episode to know how you can do this.

If you love my content please SHARE my courses to your friends. You can share this course, to your Facebook, WhatsApp etc.

For more contents related to Software Development visit my website.



  1. Hi Khan sahab, can you tell which is better dataBinding or view binding,, ThankYou

  2. what if we crate the viewModel using ViewModelFactory, how will you handle this with the BaseFragment?

  3. There is always something new we learn from your tutorials. I will use this approach in my next project. Thank you

  4. Hi Belal. How about injecting the ViewModel in the BaseFragment, is it possible? Great video btw 😉

  5. I want to know that what if some fragment don't require the viewmodel? Do we need to pass the viewmodel compulsory?

  6. Hi bilal
    Ur video is very helpful
    And m already follow ur MVVM tutorial course in my project and now by using this tips I can reduce my code, bt I'm confused how we deal if we have to use HomeViewModelFactory class(for passing the parameter in view model as u describe in ur MVVM tutorial)
    Bcoz all fragment are not call api or no need factory. If u tells me it will help me a lot.

  7. How to pass arguments to the fragments with this BaseFragment ?? Like for example by default when we create a fragment, a factory like below is created, to be used for creating an instance of fragment. public static MyFragment newInstance(String userName) {
    MyFragment myFragment = new MyFragment();
    Bundle args = new Bundle();
    args.putString(ARG_PARAM1, userName);
    return myFragment;

  8. Great content dude! I just started making Android tutorials too 🙂 Keep up the good work!

  9. Please do make more videos. I love to watch your android videos.

Leave a Reply

Your email address will not be published. Required fields are marked *