Example usage for android.net.wifi ScanResult getClass

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

Introduction

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

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.vrem.wifianalyzer.wifi.scanner.Transformer.java

private WiFiWidth getWiFiWidth(ScanResult scanResult) {
    try {/* w  w w .j  av a2 s  .  c  o m*/
        return WiFiWidth
                .find((int) scanResult.getClass().getDeclaredField(Fields.channelWidth.name()).get(scanResult));
    } catch (Exception e) {
        // Not APK 23+ can not convert
        return WiFiWidth.MHZ_20;
    }
}