Code example for InflateException

Methods: initCause

0
            mRealOwner = realOwner;
            Class<?> c = realOwner.getClass();
            try { 
                mMethod = c.getMethod(methodName, PARAM_TYPES);
            } catch (Exception e) {
                InflateException ex = new InflateException(
                        "Couldn't resolve menu item onClick handler " + methodName +
                        " in class " + c.getName());
                ex.initCause(e);
                throw ex;
            } 
        } 
 
        public boolean onMenuItemClick(MenuItem item) {
            try { 
                if (mMethod.getReturnType() == Boolean.TYPE) {
                    return (Boolean) mMethod.invoke(mRealOwner, item);
                } else { 
                    mMethod.invoke(mRealOwner, item);
                    return true; 
                }