首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >从活动切换到导航抽屉活动

从活动切换到导航抽屉活动
EN

Stack Overflow用户
提问于 2014-08-05 01:54:55
回答 1查看 271关注 0票数 0

我在我的主要活动中使用活动。我希望通过单击我的主要意图上的按钮,将从我的主要活动转到导航抽屉活动

我从android工作室的导航向导中创建了导航抽屉。

但是当我点击按钮时,我发现了一个错误。

我使用Api 10级。安卓支持库v7,v4也在我的项目中。

我用安卓工作室。

我已经调试过这个问题了,tigger,start活动,但是它在logcat中出现了这样的错误。

代码语言:javascript
运行
复制
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

任何帮助或建议都是徒劳无功的。

`

代码语言:javascript
运行
复制
<!-- 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>`
EN

回答 1

Stack Overflow用户

发布于 2014-08-05 16:44:17

我自己找到了解决办法

我在styles.xml中发现了错误。

现在我改变了风格。正常活动的风格。

纳夫抽屉式的活动。

谢谢大家

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25130103

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档