[Solved-2 Solutions] Error inflating when extending a class
Error Description:
When trying to create a custom view GhostSurfaceCameraView that extends SurfaceView. Here's the class definition file:
GhostSurfaceCameraView.java
And this is in the ghostviewscreen.xml:
Now in the activity we make:
When setContentView() gets called, an exception is thrown:
Solution 1:
Here's the fix:
Solution 2:
Another possible cause of the "Error inflating class" message could be misspelling the full package name where it's specified in XML:
Opening your layout XML file in the Eclipse XML editor should highlight this problem.
Related Searches to Error inflating when extending a class
binary xml file error inflating classerror inflating class custom viewerror inflating class androidandroid error inflating class unknownbinary xml file line error inflating classandroid view inflateexception custom viewerror inflating class calligraphycalligraphylayoutinflater out of memoryandroid.view.inflateexception custom viewbinary xml file error inflating classerror inflating class androidbinary xml file line error inflating classandroid error inflating class unknownerror inflating custom linearlayoutcalligraphylayoutinflater out of memoryerror inflating class calligraphy