NullPointerException that doesn't point to any line in my code

后端 未结 5 1961
無奈伤痛
無奈伤痛 2020-12-04 19:22

I am working on a game where the player can drag and drop things around the screen. I\'ve got a private method which allows me to simulate a drag/drop event for any of the i

5条回答
  •  攒了一身酷
    2020-12-04 20:06

    My guess is that it is a multi threading problem. It looks like the internal android render loop is encountering a null pointer due to the fact that you removed the image from another thread. The Android UI framework is single threaded and all modifications to the UI must happen in the UI thread. If this is the problem you are encountering then you can just delegate your call to the UI thread.

    There is some related information here: android threading

提交回复
热议问题