Exception right off the bat

前端 未结 1 561
既然无缘
既然无缘 2021-01-06 11:59

I am trying to run the FragmentLayout sample program using android:minSdkVersion=\"15\"

It crashed right off the bet doing SetContentView(), getting below exception:

相关标签:
1条回答
  • 2021-01-06 12:21

    Lowercase 'f' is needed in the layout.

    <fragment> is a special tag interpreted by the Activity rather than being instantiated as a normal class (e.g., LinearLayout).

    <?xml version="1.0" encoding="UTF-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    <fragment class="net.examples.HelloFragmentLayout.TitlesFragment"
        android:id="@+id/titles"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    
    </FrameLayout> 
    
    0 讨论(0)
提交回复
热议问题