Android examples for java.lang.reflect:Method
reflect Class Method
//package com.java2s; import java.lang.reflect.Method; import android.text.TextUtils; public class Main { static Method reflectClassMethod(Class<?> clazz, String methodName, boolean isEqualsIgnoreCase) { if (clazz == null || TextUtils.isEmpty(methodName)) return null; Method[] methods = clazz.getMethods(); for (Method method : methods) { if ((isEqualsIgnoreCase && method.getName().equalsIgnoreCase( methodName))//www. ja v a 2 s . c o m || method.getName().equals(methodName)) { return method; } } return null; } }