onDestory进行释放Handler时,需要判断null
if(null != mHandler) {
mHandler.removeMessages(MSG_CHANGE_TEXT_COLOR);
mHandler.removeMessages(MSG_JUMP_TO_SUCCESS_PAGE);
mHandler.removeMessages(MSG_PLAY_LITTLE_PEOPLE_ANIMATION);
mHandler.removeMessages(MSG_PLAY_WRONG_ANIMATION);
mHandler.removeMessages(MSG_SPEAK_BUTTON_STATE_CHANGED);
mHandler = null;
DebugLog.d(TAG, "release Handler success");
}
java.lang.NullPointerException: Attempt to invoke virtual method 'void 、Handler.removeMessages(int)' on a null object reference
时间: 2024-12-22 09:16:54