Example usage for android.net.wifi WifiConfiguration getClass

List of usage examples for android.net.wifi WifiConfiguration getClass

Introduction

In this page you can find the example usage for android.net.wifi WifiConfiguration getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.wahtod.wififixer.ui.ConnectFragment.java

private static WifiConfiguration addHiddenFields(WifiConfiguration w) {
    try {//w w  w.  ja v  a2s .c om
        Field f = w.getClass().getField(IP_ASSIGNMENT);
        Field f2 = w.getClass().getField(PROXY_SETTINGS);
        Class<?> ipc = Class.forName(IPASSIGNMENT_CLASS);
        Class<?> proxy = Class.forName(PROXY_CLASS);
        Field dhcp = ipc.getField(DHCP_CONSTANT);
        Field none = proxy.getField(NONE_CONSTANT);
        Object v = dhcp.get(null);
        Object v2 = none.get(null);
        f.set(w, v);
        f2.set(w, v2);
    } catch (Exception e) {
        /*
         * Log
        */
        e.printStackTrace();
    }
    return w;
}