error inflating class fragment?

时间:2016-12-02 05:11:06

标签: android android-fragments

I am currently making a practice app and am learning about using fragments. I want to make multiple activities so I can showcase a linear progression of complexity next time I come back to it if I forget about something considering fragments. Thing is, I copied and created an exact replica of the fragment activity and everything else that went along with it ( I added a "2" to the end of the name on everything I needed to ) yet the original one always works without fail but the second one crashes the app and gives me the causes:

Caused by: android.view.InflateException: Binary XML file line #15: Binary XML file line #15: Error inflating class fragment
               Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class fragment
               Caused by: android.util.SuperNotCalledException: Fragment PRCourseListFragment2{22a6fc5 #1 id=0x7f0d0082} did not call through to super.onCreate()

it also gives me this area where there is an issue:

DemoActivity3.onCreate(DemoActivity3.java:15)

but this is what the line it's referring to looks like:

setContentView(R.layout.demo_activity_3);

I've been looking for hours and I cannot see what's the problem. The code is a carbon copy of code that already works ( and it's in the same app too! ), and the printstacktrace really wasn't any help either. I already tried a few solutions to fixing the "error inflating class fragment " error but none worked.

If any of you want more of the code in order to help me, you will need to message me. There is too much code all in all to fit in a post. Any help will greatly be appreciated, as I am truly dumbfounded as to what the issue is.

0 个答案:

没有答案