try {
Class<?> mClass = Class.forName("com.android.server.wifi.WifiSettingsStore");
Constructor con=mClass.getDeclaredConstructor(Context.class);
if(!con.isAccessible()){
con.setAccessible(true);
}
Object store = con.newInstance(this);
Method[] methods = mClass.getDeclaredMethods();
Method method = null;
for(Method m:methods){
if(m.getName().equalsIgnoreCase("getPersistedScanAlwaysAvailable")){
method = m;
break;
}
}
if(!method.isAccessible()){
method.setAccessible(true);
}
Object a = method.invoke(store);
Log.e("a", a.toString());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}版权声明:本文为博主原创文章,未经博主允许不得转载。
原文:http://blog.csdn.net/yuanyl/article/details/47779883