Android examples for java.lang.reflect:Method Get
get Method from current class or parent class
//package com.java2s; import java.lang.reflect.Method; public class Main { public static Method getMethod(Class clazz, boolean methodDeclaredInClass, String methodName, Class methodArgsTypes[]) throws Exception { Method method;//from w ww.j av a 2 s . co m if (methodDeclaredInClass) method = clazz.getDeclaredMethod(methodName, methodArgsTypes); else method = clazz.getMethod(methodName, methodArgsTypes); if (!method.isAccessible()) method.setAccessible(true); return method; } }