我在运行“我的第一个应用程序”时遇到此错误。来自Android Developer教程:
java.lang.IllegalStateException:此Activity已经有一个动作 酒吧提供的窗户装饰。不要求 Window.FEATURE_SUPPORT_ACTION_BAR并将windowActionBar设置为false 你的主题改为使用工具栏
我的活动显示Message.mxl如下所示:
<android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_display_message" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_dialog_email" />
如何解决此错误? 我认为我需要插入像
这样的代码<item name="windowActionBar">false</item>
某处某处?
如果有帮助我可以包含我的java代码,但我确定显示消息xml中有错误