Android:Canvas and onTouchListener
I have an application which has a canvas where I can draw free hand stuff. Now, I would want to display a toast message on the MotionEvent.KEY_UP event which can be handled in the开发者_运维知识库 onTouchListener handler. As of now I've used console or System.out.println to display my message. The application force closes if I use Toast. Kindly help.
You need to run this on the UI thread.
Look at this: http://developer.android.com/resources/articles/painless-threading.html
精彩评论