android.os.Handler.removeMessages doesn't work when boxing value type as msg.obj
问题 (NOTE: I am re-writing my question because my first version was inaccurate). Given the following code: Handler handler = new Handler(); Message msg = handler.obtainMessage(12345, 67890L); handler.sendMessageDelayed(message, 10000); ... handler.removeMessages(12345, 67890L); The problem is that the message still fires 10 seconds after I sent it! Why isn't handler.removeMessages removing the message? 回答1: The problem is the auto-boxing of the long to a Long Object. In the debugger of