java - referencing ints from other classes -
How do I do this if I want to refer to an int from another class?
increases the public class zoom {Personal Image Image; Public int zoom controller = 20; Public zoom (reference reference) {super (reference); Image = context.getResources () getDrawable (R.drawable.icon). SetFocusable (true); } @ Override Scared Protected Zero (Canvas Canvas) {Super. Don (canvas); Image.setBounds (getWidth) / 2) -zum controller, getHeight () / 2) -zum controller, getWidth () / 2) zoom controller, (getHeight () / 2) + zoom controller); Image.draw (canvas); }} Class HelloOnTouchListener applies OnTouchListener {@Override Public Boolean OnTouch (see ARG0, MotionEvent arg1) {Back to Truth; }} In this case I want to refer to the zoom controller from the first class in the second HelloOnTouchListener class.
You have to create some gates like the first class.
public int GetZoomController () {return zoomController; } And it will be in your audience.
((zoom) arg0) .getZoomController ();
Comments
Post a Comment