gpt4 book ai didi

android - java.lang.RuntimeException : Unable to resume activity Android 错误

转载 作者:太空狗 更新时间:2023-10-29 15:27:14 28 4
gpt4 key购买 nike

我正在尝试获取设备蓝牙地址,所以每当我点击发送时

startActivityForResult(new Intent(getApplicationContext(),
DeviceListActivity.class), GET_DEVICE_TO_SEND);

通过蓝牙文件 Discovery 完成后开始我选择一个已建立的设备

onActivityResult我有这些代码

if (requestCode == GET_DEVICE_TO_SEND && resultCode == RESULT_OK) {
String device = data
.getStringExtra(DeviceListActivity.DEVICE_ADDRESS);
String name = data.getStringExtra(DeviceListActivity.DEVICE_NAME);

函数 onActivityResult 被调用,然后应用程序停止

类:MainUI 包含 Tabhost。

FilesUI类是onActivityResult函数所在的类

日志

03-19 18:39:28.858: E/AndroidRuntime(22817): java.lang.RuntimeException: Unable to resume activity {com.android.Connect/com.android.Connect.UI.MainUI}: java.lang.RuntimeException:`enter code here` Failure delivering result ResultInfo{who=Files, request=1, result=-1, data=Intent { (has extras) }} to activity {com.android.Connect/com.android.Connect.UI.MainUI}: java.lang.NullPointerException

最佳答案

问题就在这里

  String msg = "file," + fileToSend.getName() + "," + readFileAsString(fileToSend.getPath()); Log.d(TAG, "the file " + msg);  

关于android - java.lang.RuntimeException : Unable to resume activity Android 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15508227/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com