Unable to instantiate fragment XXX make sure class name exists, is public, and has an empty constru
来源:互联网 发布:什么牌网络机顶盒好 编辑:程序博客网 时间:2024/05/21 03:54
9 D AndroidRuntime: Shutting down VM03-13 14:03:00.341587 30529 30529 W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41d1ece0)03-13 14:03:00.341591 30529 30529 W dalvikvm: threadid=1: uncaught exception occurred03-13 14:03:00.341658 30529 30529 W System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.dialer/com.android.dialer.DialtactsActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.mediatek.dialer.calllogex.CallLogFragmentEx: make sure class name exists, is public, and has an empty constructor that is public03-13 14:03:00.341796 30529 30529 W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)03-13 14:03:00.341816 30529 30529 W System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)03-13 14:03:00.341834 30529 30529 W System.err: at android.app.ActivityThread.access$800(ActivityThread.java:151)03-13 14:03:00.341849 30529 30529 W System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)03-13 14:03:00.341864 30529 30529 W System.err: at android.os.Handler.dispatchMessage(Handler.java:110)03-13 14:03:00.341878 30529 30529 W System.err: at android.os.Looper.loop(Looper.java:193)03-13 14:03:00.341891 30529 30529 W System.err: at android.app.ActivityThread.main(ActivityThread.java:5299)03-13 14:03:00.341912 30529 30529 W System.err: at java.lang.reflect.Method.invokeNative(Native Method)03-13 14:03:00.341927 30529 30529 W System.err: at java.lang.reflect.Method.invoke(Method.java:515)03-13 14:03:00.341941 30529 30529 W System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)03-13 14:03:00.341955 30529 30529 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)03-13 14:03:00.341969 30529 30529 W System.err: at dalvik.system.NativeStart.main(Native Method)03-13 14:03:00.342011 30529 30529 W System.err: Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.mediatek.dialer.calllogex.CallLogFragmentEx: make sure class name exists, is public, and has an empty constructor that is public03-13 14:03:00.342929 30529 30529 W System.err: at android.app.Fragment.instantiate(Fragment.java:601)03-13 14:03:00.342950 30529 30529 W System.err: at android.app.FragmentState.instantiate(Fragment.java:98)03-13 14:03:00.342968 30529 30529 W System.err: at android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1759)03-13 14:03:00.342984 30529 30529 W System.err: at android.app.Activity.onCreate(Activity.java:899)03-13 14:03:00.343006 30529 30529 W System.err: at com.android.contacts.common.activity.TransactionSafeActivity.onCreate(TransactionSafeActivity.java:32)03-13 14:03:00.343021 30529 30529 W System.err: at com.android.dialer.DialtactsActivity.onCreate(DialtactsActivity.java:395)03-13 14:03:00.343036 30529 30529 W System.err: at android.app.Activity.performCreate(Activity.java:5264)03-13 14:03:00.343052 30529 30529 W System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)03-13 14:03:00.343066 30529 30529 W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)03-13 14:03:00.343086 30529 30529 W System.err: ... 11 more03-13 14:03:00.343107 30529 30529 W System.err: Caused by: java.lang.InstantiationException: can't instantiate class com.mediatek.dialer.calllogex.CallLogFragmentEx; no empty constructor03-13 14:03:00.343226 30529 30529 W System.err: at java.lang.Class.newInstanceImpl(Native Method)03-13 14:03:00.343242 30529 30529 W System.err: at java.lang.Class.newInstance(Class.java:1215)03-13 14:03:00.343257 30529 30529 W System.err: at android.app.Fragment.instantiate(Fragment.java:590)03-13 14:03:00.343269 30529 30529 W System.err: ... 19 more03-13 14:03:00.343281 30529 30529 W dalvikvm: threadid=1: calling UncaughtExceptionHandler
我是 直接加了fragment构造方法,CallLogFragmentEx mCallLogFragmentEx = new mCallLogFragmentEx(true);导致报错
解决方法:自定义的fragment最好有一个Public的参数为空的构造函数,若需要传入一个参数,可以使用下面的方法
public FileViewFragment(){ }
public static FileViewFragment getInstance(A a){
FileViewFragment fileViewFragment = new FileViewFragment();
fileViewFragment.a = a;
return fileViewFragment;
}
0 0
- Unable to instantiate fragment XXX make sure class name exists, is public, and has an empty constru
- Unable to instantiate fragment make sure class name exists, is public, and has an empty constructor
- Unable to instantiate fragment make sure class name exists, is public, and has an empty constructor
- 关于make sure class name exists, is public, and has an empty constructor that is public解决办法
- Unable to instantiate fragment com.viewpager.demo.FirstFragment: make sure class name exists, is pub
- Unable to instantiate fragment make sure class name....
- Unable to instantiate fragment com.doov.music.online.search.SearchHWRFragment: make sure class name
- Cannot write to snapshot prefix '***'. Make sure that the directory exists and is writeable解决方法
- Flex warning: unable to bind to property 'name' on class 'Object' (class is not an IEventDispatcher)
- 481_make sure class name exists错误
- Alias "bootstrap.widgets.TbHeroUnit" is invalid. Make sure it points to an existing PHP file and the
- Android Unable to instantiate fragment
- android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment xxx.fragments
- Error: Unable to import PyQt4.QtCore. Make sure PyQt4 is installed.
- unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correct
- android googlemap v2 Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make s
- Unable to instantiate fragment 的解
- Android "Unable to instantiate fragment"解决方案
- 完美的 App测试方案
- 13 子Shell与进程处理
- php中单引号和双引号的区别
- leetcode Remove Element
- 14 Shell脚本调试技术
- Unable to instantiate fragment XXX make sure class name exists, is public, and has an empty constru
- GCD 线程
- idea运行spark的wordcount与eclipse运行spark的wordcount示例,及本地运行sparkpi
- crash案例解析
- 设置vss为vs2010的默认源码管理器
- Python基础2 容器
- 初创团队-App如何在夹缝中生存
- 黑马程序员__IO之文件复制、分割与合并
- AndroidLoader详解