Android examples for java.lang.reflect:Field
dump Field from a Class
import java.lang.reflect.Field; import android.util.Log; public class Main { private static final String TAG = ""; public static void dumpField(Class clazz, String fieldName) { Field[] fs = clazz.getDeclaredFields(); for (Field f : fs) { if (f.getName().startsWith(fieldName)) { Log.d(TAG, "method name: " + f.getName()); Log.d(TAG, "]"); }//from w w w . j a v a 2 s . c o m } } }