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