I have a class like this:
class TopicFragment extends Fragment{
public TopicFragment(VO vO) {
// some code
}
}
Users are reporting that the app is crashing and the log says this:
android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.aaa.wert.TopicFragment: make sure class name exists, is public, and has an empty constructor that is public
I have looked into this links but i am not able to solve this;
Do fragments really need an empty constructor?
Fragment - InstantiationException: no empty Constructor -> Google Maps v2?
Please help me with this.
Just simply add an empty constructor with no parameters which is public. if you have the fragment set in XML without an empty constructor it cannot be created.
I also usually always have just the empty constructor and have a method like this to instantiate with arguments
EDIT: and as the guys said in the comments make your class: