Android examples for java.lang.reflect:Method Get
get Declared Method from current class
//package com.java2s; import java.lang.reflect.Method; public class Main { public static Method getDeclaredMethod(Object object, String methodName, Class<?>... parameterTypes) { Method method = null;// w w w . j a v a 2 s . com for (Class<?> clazz = object.getClass(); clazz != Object.class; clazz = clazz .getSuperclass()) { try { method = clazz .getDeclaredMethod(methodName, parameterTypes); return method; } catch (Exception e) { } } return null; } }