Android examples for java.lang.reflect:Field Value
get Int File Value From Class
//package com.java2s; import java.lang.reflect.Field; public class Main { public static int getIntFileValueFromClass(Class c, String filedName) { Field fild = null;/*from w ww. j a v a 2 s . co m*/ int fildValue = 0; try { fild = c.getDeclaredField(filedName); fild.setAccessible(true); fildValue = fild.getInt(c); } catch (NoSuchFieldException ex) { } catch (Exception ex) { } return fildValue; } }