标签:
原因:getStringExtra()为空导致
解决:用以下判断接收
Bundle bundle = intent.getExtras(); if (bundle != null) { String data = bundle.getString(BluetoothLeService.EXTRA_DATA); if (data != null) { } }
Bundle bundle = intent.getExtras();
if (bundle != null) {
String data = bundle.getString(BluetoothLeService.EXTRA_DATA);
Log.e("mainData1",data);
//显示到界面
if (data != null) {
Log.e("mainData2",data);
//初始化圆形进度条
initArcProgressBar(100,Integer.parseInt(data),"优");
}
}
接收蓝牙广播onReceive中getStringExtra()出现错误
标签:
原文地址:http://www.cnblogs.com/goodpan/p/5573518.html