我在我的主要活动中使用活动。我希望通过单击我的主要意图上的按钮,将从我的主要活动转到导航抽屉活动。
我从android工作室的导航向导中创建了导航抽屉。
但是当我点击按钮时,我发现了一个错误。
我使用Api 10级。安卓支持库v7,v4也在我的项目中。
我用安卓工作室。
我已经调试过这个问题了,tigger,start活动,但是它在logcat中出现了这样的错误。
java.lang.RuntimeException: Unable to start activity ComponentInfo{www.epicmyanmar.com.andropos/www.epicmyanmar.com.andropos.MyActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class fragment任何帮助或建议都是徒劳无功的。
`
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
` `<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="www.epicmyanmar.com.andropos.MyActivity">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
`enter code here`<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
If you're not building against API 17 or higher, use
android:layout_gravity="left" instead. -->
<!-- The drawer is given a fixed width in dp and extends the full height of
the container. -->
<fragment android:id="@+id/navigation_drawer"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
class="www.epicmyanmar.com.andropos.NavigationDrawerFragment"
tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>`发布于 2014-08-05 16:44:17
我自己找到了解决办法
我在styles.xml中发现了错误。
现在我改变了风格。正常活动的风格。
纳夫抽屉式的活动。
谢谢大家
https://stackoverflow.com/questions/25130103
复制相似问题