fun getPrivateValue(device: BluetoothDevice?):Int{
try {
val activityManagerClass =
Class.forName("android.bluetooth.BluetoothDevice")//类名
val getCurrentUserMethod =
activityManagerClass.getMethod("getAdapterIndex")//方法
return getCurrentUserMethod.invoke(device) as Int
}catch (e: Exception){
LogUtils.d(TAG,"error")
}
return -1
}
Android 反射
阿道夫小狮子2025-12-02 11:27
相关推荐
子兮曰6 小时前
OpenClaw入门:从零开始搭建你的私有化AI助手吴仰晖6 小时前
使用github copliot chat的源码学习之Chromium Compositor1024小神6 小时前
github发布pages的几种状态记录Doro再努力8 小时前
【Linux操作系统10】Makefile深度解析:从依赖推导到有效编译不像程序员的程序媛8 小时前
Nginx日志切分Daniel李华9 小时前
echarts使用案例北原_春希9 小时前
如何在Vue3项目中引入并使用Echarts图表JY-HPS9 小时前
echarts天气折线图尽意啊9 小时前
echarts树图动态添加子节点吃面必吃蒜9 小时前
echarts 极坐标柱状图 如何定义柱子颜色