错误代码时这样的

解决方案 »

  1.   


    两个activity的代码跳转到的activity对应的layout代码
      

  2.   

    我的布局文件也没有报错啊,是不是因为android ID里取了一些软件识别不了的名字
      

  3.   

    /**
         * Creates a view from a tag name using the supplied attribute set.
         * <p>
         * <strong>Note:</strong> Default visibility so the BridgeInflater can
         * override it.
         *
         * @param parent the parent view, used to inflate layout params
         * @param name the name of the XML tag used to define the view
         * @param context the inflation context for the view, typically the
         *                {@code parent} or base layout inflater context
         * @param attrs the attribute set for the XML tag used to define the view
         * @param ignoreThemeAttr {@code true} to ignore the {@code android:theme}
         *                        attribute (if set) for the view being inflated,
         *                        {@code false} otherwise
         */
        View createViewFromTag(View parent, String name, Context context, AttributeSet attrs,
                boolean ignoreThemeAttr) {
            if (name.equals("view")) {
                name = attrs.getAttributeValue(null, "class");
            }        // Apply a theme wrapper, if allowed and one is specified.
            if (!ignoreThemeAttr) {
                final TypedArray ta = context.obtainStyledAttributes(attrs, ATTRS_THEME);
                final int themeResId = ta.getResourceId(0, 0);
                if (themeResId != 0) {
                    context = new ContextThemeWrapper(context, themeResId);
                }
                ta.recycle();
            }        if (name.equals(TAG_1995)) {
                // Let's party like it's 1995!
                return new BlinkLayout(context, attrs);
            }        try {
                View view;
                if (mFactory2 != null) {
                    view = mFactory2.onCreateView(parent, name, context, attrs);
                } else if (mFactory != null) {
                    view = mFactory.onCreateView(name, context, attrs);
                } else {
                    view = null;
                }            if (view == null && mPrivateFactory != null) {
                    view = mPrivateFactory.onCreateView(parent, name, context, attrs);
                }            if (view == null) {
                    final Object lastContext = mConstructorArgs[0];
                    mConstructorArgs[0] = context;
                    try {
                        if (-1 == name.indexOf('.')) {
                            view = onCreateView(parent, name, attrs);
                        } else {
                            view = createView(name, null, attrs);
                        }
                    } finally {
                        mConstructorArgs[0] = lastContext;
                    }
                }            return view;
            } catch (InflateException e) {
                throw e;        } catch (ClassNotFoundException e) {
                final InflateException ie = new InflateException(attrs.getPositionDescription()
                        + ": Error inflating class " + name, e);
                ie.setStackTrace(EMPTY_STACK_TRACE);
                throw ie;        } catch (Exception e) {
                final InflateException ie = new InflateException(attrs.getPositionDescription()
                        + ": Error inflating class " + name, e);
                ie.setStackTrace(EMPTY_STACK_TRACE);
                throw ie;
            }
        }
      

  4.   

    从源码中看是没找到类,你看下你引用的第三方的或者源码的库有没有,比如那个DrawerLayout,这个有没有引用v4包,xml中不会检测报错的
      

  5.   


    gradle里的是这样的,改的我都脑壳疼了
      

  6.   

    使用ToolBar的时候 Style 是不是设置的 NoActionBar ?DrawerLayout 打开位置 openDrawer 有没设置错误或者对应上
      

  7.   

    我是toolbar设置了noactionbar,不过如果没有设置这个,3.0的android studio是默认带了 一个toolbar的,还有openDrawer是去哪里看,是不是按住ctrl键点drawerLayout
      

  8.   

    我是toolbar设置了noactionbar,不过如果没有设置这个,3.0的android studio是默认带了 一个toolbar的,还有openDrawer是去哪里看,是不是按住ctrl键点drawerLayout