android - My program continuous gives error. Can you help me? I have tried so hard but didn't improve the error -
03-11 15:03:32.743: e/androidruntime(1556): fatal exception: main 03-11 15:03:32.743: e/androidruntime(1556): process: com.example.takipci, pid: 1556 03-11 15:03:32.743: e/androidruntime(1556): java.lang.runtimeexception: unable start activity componentinfo{com.example.takipci/com.example.takipci.ayarlaractivity}: java.lang.runtimeexception: subclasses of preferenceactivity must override isvalidfragment(string) verify fragment class valid! com.example.takipci.ayarlaractivity has not checked if fragment com.example.takipci.fragment.gizlilikpreferencesfragment valid. 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activitythread.performlaunchactivity(activitythread.java:2195) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activitythread.access$800(activitythread.java:135) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activitythread$h.handlemessage(activitythread.java:1196) 03-11 15:03:32.743: e/androidruntime(1556): @ android.os.handler.dispatchmessage(handler.java:102) 03-11 15:03:32.743: e/androidruntime(1556): @ android.os.looper.loop(looper.java:136) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activitythread.main(activitythread.java:5017) 03-11 15:03:32.743: e/androidruntime(1556): @ java.lang.reflect.method.invokenative(native method) 03-11 15:03:32.743: e/androidruntime(1556): @ java.lang.reflect.method.invoke(method.java:515) 03-11 15:03:32.743: e/androidruntime(1556): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) 03-11 15:03:32.743: e/androidruntime(1556): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) 03-11 15:03:32.743: e/androidruntime(1556): @ dalvik.system.nativestart.main(native method) 03-11 15:03:32.743: e/androidruntime(1556): caused by: java.lang.runtimeexception: subclasses of preferenceactivity must override isvalidfragment(string) verify fragment class valid! com.example.takipci.ayarlaractivity has not checked if fragment com.example.takipci.fragment.gizlilikpreferencesfragment valid. 03-11 15:03:32.743: e/androidruntime(1556): @ android.preference.preferenceactivity.isvalidfragment(preferenceactivity.java:898) 03-11 15:03:32.743: e/androidruntime(1556): @ android.preference.preferenceactivity.switchtoheaderinner(preferenceactivity.java:1179) 03-11 15:03:32.743: e/androidruntime(1556): @ android.preference.preferenceactivity.switchtoheader(preferenceactivity.java:1199) 03-11 15:03:32.743: e/androidruntime(1556): @ android.preference.preferenceactivity.oncreate(preferenceactivity.java:545) 03-11 15:03:32.743: e/androidruntime(1556): @ com.example.takipci.ayarlaractivity.oncreate(ayarlaractivity.java:20) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activity.performcreate(activity.java:5231) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1087) 03-11 15:03:32.743: e/androidruntime(1556): @ android.app.activitythread.performlaunchactivity(activitythread.java:2159) 03-11 15:03:32.743: e/androidruntime(1556): ... 11 more
the exception states:
subclasses of preferenceactivity must override isvalidfragment(string) verify fragment class valid! com.example.takipci.ayarlaractivity has not checked if fragment com.example.takipci.fragment.gizlilikpreferencesfragment valid.
in ayarlaractivity
need add following:
@override protected boolean isvalidfragment(string fragmentname) { return gizlilikpreferencesfragment.class.getname().equals(fragmentname) || super.isvalidfragment(fragmentname); }
Comments
Post a Comment