Skip to content Skip to sidebar Skip to footer

Android Fragments: Container Variable In Oncreateview Is Null

i have an application that is only fragment based, and actually (i'm just creating basic content) i have only one fragment, declared directly into the layout:

Solution 1:

In your main layout, try using android:layout_width="match_parent" instead of android:layout_width="0dp".

And you shouldn't be calling onSaveInstanceState(savedInstanceState) in onCreate; it is called by the framework when your fragment is going down to allow it to save its state.

Post a Comment for "Android Fragments: Container Variable In Oncreateview Is Null"