java - 面对 java.lang.ClassCastException:android.net.DhcpInfo 无法转换为 android.bluetooth.BluetoothDevice
问题描述
这是我面临提到的 ClassCast 异常的代码行。
BluetoothDevice 设备 = (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
我正在将对象类型转换为 BluetoothDevice,但仍然面临问题。我能知道出了什么问题以及处理这个 ClassCast 异常的方法是什么。
解决方案
推荐阅读
- mips - 为什么我的字符串长度子程序会给出一个无限循环?
- node.js - 有没有办法覆盖 NodeJS 中的传出连接?
- hadoop - Hue Filebrowser Search 仅在第一层搜索
- wordpress - 如何使用(ba)sh cURL 发布到具有基本身份验证的 Wordpress?
- node.js - firebase 函数在完成代码处理之前返回
- android - Error when inflating Bottom Navigation View even though the bottom_navigation.xml is right
- variables - One method with 3 variables
- javascript - 茉莉花间谍没有找到财产
- php - 应该将哪些参数传递给 PDO::__construct()?
- powershell - 如何从我的批处理文件中打开“保存”对话框