Code example for Field

Methods: set, setAccessible

0
 
  private static void setDeclaredField(Object obj, String name, Object value)
      throws SecurityException, NoSuchFieldException, IllegalArgumentException, 
      IllegalAccessException { 
    Field f = obj.getClass().getDeclaredField(name);
    f.setAccessible(true);
    f.set(obj, value);
  } 
 
  /** 
   * Override WebKit Proxy settings 
   * 
   * @param ctx Android ApplicationContext 
   * @return true if Proxy was successfully set 
   */ 
  public static boolean setProxy(Context ctx, String host, int port) {
    boolean ret = false;
    setSystemProperties(host, port);
 
    try { 
      if (Build.VERSION.SDK_INT < 14) {