Android examples for java.lang.reflect:Field Value
get Field Value as Object
//package com.java2s; import java.lang.reflect.Field; public class Main { public static Object getFieldValueObject(Object obj, Field field) { try {// w ww. j av a 2 s . c o m return field.get(obj); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; } }