开发者

Sending a menu item selection to a custom view's onTouch method

开发者 https://www.devze.com 2023-02-07 18:11 出处:网络
I\'m writing a custom view to be able to draw on a bitmap and I\'d like to be able to pass a menu selection from my activity to have the onTouch do different things. 开发者_JAVA技巧For instance, if yo

I'm writing a custom view to be able to draw on a bitmap and I'd like to be able to pass a menu selection from my activity to have the onTouch do different things. 开发者_JAVA技巧For instance, if you select circle from the menu then the onTouch will draw a circle, if rectangle, a rectangle etc. Am I going about this the right way? Is there a way to pass the menu item selection to the view?


I ended up using a getter/setter to accomplish this. Not sure if that's the best way but it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消