Android 新活动崩溃';s调用OnCreate
在启动名为Home Screen的活动时,应用程序在尝试读取第36行的XML文件时崩溃,错误如下:Android 新活动崩溃';s调用OnCreate,android,xml,Android,Xml,在启动名为Home Screen的活动时,应用程序在尝试读取第36行的XML文件时崩溃,错误如下: Binary XML file line #36: Error inflating class fragment <fragment android:name="com.example.myName.myApp.EventsFragment" android:id="@+id/events_frag" android:layout_width="ma
Binary XML file line #36: Error inflating class fragment
<fragment
android:name="com.example.myName.myApp.EventsFragment"
android:id="@+id/events_frag"
android:layout_width="match_parent"
android:layout_height="464dp"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true" />
您需要在
主屏幕中实现OnFragmentInteractionListener
。Java
活动。该侦听器实现丢失,导致崩溃
该日志明确说明:
Caused by: java.lang.RuntimeException: com.example.braedanshigley.feelbettertogether.HomeScreen@d0dbff6 must implement OnFragmentInteractionListener
您好,您的片段名称包正确吗?
com.example.myName.myApp.events片段此片段必须是片段类顶部的片段您可以发布崩溃堆栈跟踪吗?@shhp已添加!非常感谢你费心去看。非常感谢!现在我觉得不仔细看很傻:P
Caused by: java.lang.RuntimeException: com.example.braedanshigley.feelbettertogether.HomeScreen@d0dbff6 must implement OnFragmentInteractionListener