Skip to content Skip to sidebar Skip to footer

How To Fix Error Inflating Class Null

I am trying to make a scrollable tab but when I set a view in my fragment layout the app starts giving error as Error inflating class null.It was working whenthe view is not added

Solution 1:

Replace

<view

with

<View

View is an actual widget you can inflate and seems to fit your intended purpose. view is a special tag and with it you can inflate view classes by a name defined in attributes, and you have not defined such class name (it comes up as null in inflater).

Solution 2:

You need to define the proper package name for the view class. By looking at the package name defined in your class you can define it in your layout xml like this

<com.example.neelay.anotherbeatbox.Fragment.Songsandroid:layout_width="match_parent"android:layout_height="1dp"android:background="#fff"android:layout_marginTop="150dp"/>

Post a Comment for "How To Fix Error Inflating Class Null"