Android examples for java.lang.reflect:Method Get
get Class Method by class name and method parameters
//package com.java2s; import java.lang.reflect.*; public class Main { public static Method getClassMethod(Class clazz, String methodName, Class<?>... fieldParams) throws NoSuchMethodException { try {/*from w w w. j av a 2 s.c o m*/ return clazz.getDeclaredMethod(methodName, fieldParams); } catch (NoSuchMethodException e) { Class superClass = clazz.getSuperclass(); if (superClass == null) { throw e; } else { return getClassMethod(superClass, methodName, fieldParams); } } } }