get Metered Hint from wifi information - Android Phone

Android examples for Phone:wifi

Description

get Metered Hint from wifi information

Demo Code


//package com.java2s;

import android.net.wifi.WifiInfo;

import java.lang.reflect.Method;

public class Main {
    public static boolean getMeteredHint(WifiInfo info) {
        boolean ret = false;
        try {/*  w w  w . j  ava  2  s  .c om*/
            Method m = info.getClass().getDeclaredMethod("getMeteredHint");
            m.setAccessible(true);
            ret = (Boolean) m.invoke(info);
        } catch (Exception e) {

        }
        return ret;
    }
}

Related Tutorials