Some of my users experience crashes, and this is the error that appears in the crash report in the Google Play Developer Console:
Unable to start activity ComponentInfo{com.havens1515.autorespond/com.havens1515.autorespond.SettingsMenuNew}: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.havens1515.autorespond.NotificationOptions: make sure class name exists, is public, and has an empty constructor that is public
Users say that this happens when you open any settings menu inside SettingsMenuNew, which is mentioned in the above error, but I do not experience an accident on my phone. SettingsMenuNew- this PreferenceActivity, and all the submenusPreferenceFragment
Everyone PreferenceFragmenthas an empty constructor, and I don't know what else might be the problem. I also saw in another question that he needed a method newInstance, but I don’t think I really need it if I did not put any other arguments in the fragment.
here is the code that shows these methods:
public class NotificationOptions extends PreferenceFragment
{
public NotificationOptions()
{
}
public static NotificationOptions newInstance(int title, String message)
{
NotificationOptions f = new NotificationOptions();
return f;
}
...
}
Randy source
share