首页 > 解决方案 > 面对 java.lang.ClassCastException:android.net.DhcpInfo 无法转换为 android.bluetooth.BluetoothDevice

问题描述

这是我面临提到的 ClassCast 异常的代码行。

BluetoothDevice 设备 = (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

我正在将对象类型转换为 BluetoothDevice,但仍然面临问题。我能知道出了什么问题以及处理这个 ClassCast 异常的方法是什么。

标签: javaandroidbluetoothclasscastexceptiondhcp

解决方案


推荐阅读