Android Handler Message and ListView

前端 未结 1 1511
执念已碎
执念已碎 2021-01-02 09:31

Here\'s my error:

*** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
android.util.AndroidRuntimeException: { what=1008 when         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 10:16

    My guess would be that you are sending twice the same message. Indeed in the code there is one new Message() and two mHandler.sendMessage(m) which are possibly both executed.

    Try making a new message for every time you send a message.

    Edited:

    Message.obtain() is preferable to Message m = new Message() (because it recycles used messages under the hood)

    In your case you could use new.copyFrom(old) if you need a copy of existing message.

    0 讨论(0)
提交回复
热议问题