Every fragment must have an empty constructor Android Java Class

You have to add constructor!

    public static class YourFragment extends Fragment {
    //you have to add constructor!!!!!	
    public YourFragment(){}
 
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.activity_main, container, false);
 
            return view;
        }   
 
    }
This entry was posted in Android Examples Code and tagged . Bookmark the permalink.


Comments are closed.



6,085 views