简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM