Code example for InvocationTargetException

Methods: getTargetException

0
 
        public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
            try { 
                return m.equals(getView) && (Integer)(args[0])<0 ? getView((Integer)args[0],(View)args[1],(ViewGroup)args[2]) : m.invoke(obj, args);
            } catch (InvocationTargetException e) {
                throw e.getTargetException();
            } catch (Exception e) {
                throw new RuntimeException(e);
            } 
        } 
 
 
        protected View getView(int position, View convertView, ViewGroup parent) throws IllegalAccessException {
            if( position<0 ) {
                final TextView v = (TextView) ((LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(android.R.layout.simple_spinner_item,parent,false);
                v.setText(getPrompt());
                return v;
            } 
 
            return obj.getView(position,convertView,parent);
        }