Sending a menu item selection to a custom view's onTouch method
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.
精彩评论