03-09 08:42:35.374: E/AndroidRuntime(653): FATAL EXCEPTION: main03-09 08:42:35.374: E/AndroidRuntime(653): java.lang.RuntimeException: Unable to resume activity {yo.pace.ne/yo.pace.ne.TestBluetoothActivity}: java.lang.NullPointerException03-09 08:42:35.374: E/AndroidRuntime(653): java.lang.RuntimeException: Unable to resume activity {yo.pace.ne/yo.pace.ne.TestBluetoothActivity}: java.lang.NullPointerException
……
……
……
……
我已经在AndroidManifest修改了相应的Activity名字了,不知道这次错误在哪……

解决方案 »

  1.   

    onResume方法里面出了空指针吧
      

  2.   

    贴代码好了……public synchronized void onResume() 
        {
            super.onResume();
            //如果服务创建了,而蓝牙连接状态标识量依旧是初始化则启动服务函数。
            if (myBluetoothService != null) 
            {
                // Only if the state is STATE_NONE, do we know that we haven't started already
                if (BluetoothService.getState(1) == BluetoothService.STATE_NONE && BluetoothService.getState(2) == BluetoothService.STATE_NONE) 
                {
                  myBluetoothService.start();
                }
            }
        }