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
相关推荐
IT_陈寒3 小时前
React的useState居然还有这种坑?我差点删库跑路Pedantic5 小时前
SwiftUI 手势笔记橙子家5 小时前
浏览器缓存之【结构化数据库与缓存】: IndexedDB、Cache storage 和 Storage bucketsuser20585561518135 小时前
X6 中边悬浮置顶,规避 `mouseleave` 事件丢失问题李明卫杭州5 小时前
CSS aspect-ratio 属性完全指南Pedantic7 小时前
SwiftUI 手势层级(Gesture Hierarchy)详解飘尘7 小时前
前端转型全栈(Java后端)的快速上手指引一颗烂土豆7 小时前
Meshopt 压缩深度解析,为什么它比 Draco 更快浏览器工程师8 小时前
AI Agent 接浏览器任务,先别让它一路点到底