Example usage for android.net.wifi WifiManager getClass

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

Introduction

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

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:ua.mkh.settings.full.MainActivity.java

public static boolean isSharingWiFi(final WifiManager manager) {
    try {//from   w w  w.ja  va 2  s.c o  m
        final Method method = manager.getClass().getDeclaredMethod("isWifiApEnabled");
        method.setAccessible(true); //in the case of visibility change in future APIs
        return (Boolean) method.invoke(manager);
    } catch (final Throwable ignored) {
    }

    return false;
}