Android examples for java.lang.reflect:Method Get
get Declared Method
//package com.java2s; import java.lang.reflect.Method; import android.util.Log; public class Main { public static Method getDeclaredMethod(Object object, String methodName, Class<?>[] parameterTypes) { Method method = null;/*w w w .j ava 2 s . c om*/ for (Class<?> clazz = object.getClass(); clazz != Object.class;) { try { method = clazz .getDeclaredMethod(methodName, parameterTypes); return method; } catch (Exception e) { Log.i("ReflectUtil File", ""); clazz = clazz.getSuperclass(); } } return null; } }