// Path: app/src/main/java/com/landtanin/studentattendancecheck/manager/SmartFragmentStatePagerAdapter.java
// public class SmartFragmentStatePagerAdapter extends FragmentStatePagerAdapter {
// 
//     private SparseArray<Fragment> registeredFragments = new SparseArray<Fragment>();
// 
//     public SmartFragmentStatePagerAdapter(FragmentManager fm) {
//         super(fm);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return null;
//     }
// 
//     @Override
//     public int getCount() {
//         return 0;
//     }
// 
//     // Register the fragment when the item is instantiated
//     @Override
//     public Object instantiateItem(ViewGroup container, int position) {
//         Fragment fragment = (Fragment) super.instantiateItem(container, position);
//         registeredFragments.put(position, fragment);
//         return fragment;
//     }
// 
//     // Unregister when the item is inactive
//     @Override
//     public void destroyItem(ViewGroup container, int position, Object object) {
//         registeredFragments.remove(position);
//         super.destroyItem(container, position, object);
//     }
// 
//     // Returns the fragment for the position (if instantiated)
//     public Fragment getRegisteredFragment(int position) {
//         return registeredFragments.get(position);
//     }
// }


import android.content.DialogInterface;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.landtanin.studentattendancecheck.R;
import com.landtanin.studentattendancecheck.databinding.FragmentHomeBinding;
import com.landtanin.studentattendancecheck.manager.SmartFragmentStatePagerAdapter;
        b.fragHomeTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
            @Override
            public void onTabSelected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabUnselected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabReselected(TabLayout.Tab tab) {

            }
        });

    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        // Save Instance (Fragment level's variables) State here
    }

    @SuppressWarnings("UnusedParameters")
    private void onRestoreInstanceState(Bundle savedInstanceState) {
        // Restore Instance (Fragment level's variables) State here
    }

// Path: app/src/main/java/com/landtanin/studentattendancecheck/manager/SmartFragmentStatePagerAdapter.java
// public class SmartFragmentStatePagerAdapter extends FragmentStatePagerAdapter {
// 
//     private SparseArray<Fragment> registeredFragments = new SparseArray<Fragment>();
// 
//     public SmartFragmentStatePagerAdapter(FragmentManager fm) {
//         super(fm);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return null;
//     }
// 
//     @Override
//     public int getCount() {
//         return 0;
//     }
// 
//     // Register the fragment when the item is instantiated
//     @Override
//     public Object instantiateItem(ViewGroup container, int position) {
//         Fragment fragment = (Fragment) super.instantiateItem(container, position);
//         registeredFragments.put(position, fragment);
//         return fragment;
//     }
// 
//     // Unregister when the item is inactive
//     @Override
//     public void destroyItem(ViewGroup container, int position, Object object) {
//         registeredFragments.remove(position);
//         super.destroyItem(container, position, object);
//     }
// 
//     // Returns the fragment for the position (if instantiated)
//     public Fragment getRegisteredFragment(int position) {
//         return registeredFragments.get(position);
//     }
// }


// Path: app/src/main/java/com/landtanin/studentattendancecheck/fragment/FragmentHome.java
import android.content.DialogInterface;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.landtanin.studentattendancecheck.R;
import com.landtanin.studentattendancecheck.databinding.FragmentHomeBinding;
import com.landtanin.studentattendancecheck.manager.SmartFragmentStatePagerAdapter;

        b.fragHomeTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
            @Override
            public void onTabSelected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabUnselected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabReselected(TabLayout.Tab tab) {

            }
        });

    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        // Save Instance (Fragment level's variables) State here
    }

    @SuppressWarnings("UnusedParameters")
    private void onRestoreInstanceState(Bundle savedInstanceState) {
        // Restore Instance (Fragment level's variables) State here
    }

    public class FragmentHomePagerAdapter extends SmartFragmentStatePagerAdapter {