程序在打开的时候就报错。
这是Android Monitor上的信息:
12-05 01:51:58.359 21231-21231/com.thefat.lingjunqi.enricher E/AndroidRuntime: FATAL EXCEPTION: main
12-05 01:51:58.359 21231-21231/com.thefat.lingjunqi.enricher E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thefat.lingjunqi.enricher/com.thefat.lingjunqi.enricher.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
12-05 01:51:58.359 21231-21231/com.thefat.lingjunqi.enricher E/AndroidRuntime: Caused by: java.lang.IllegalStateException: Fragment ReadingTitleFragment{414f5f38} not attached to Activity
12-05 01:51:58.359 21231-21231/com.thefat.lingjunqi.enricher E/AndroidRuntime: at android.app.Fragment.getResources(Fragment.java:762)
12-05 01:51:58.359 21231-21231/com.thefat.lingjunqi.enricher E/AndroidRuntime: at com.thefat.lingjunqi.enricher.ReadingTitleFragment.(ReadingTitleFragment.java:27)
这个地方是不是就有getActivity了,应该是还没有attached到Activity中有异常
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。