referencing ints from other classes
- by user357032
if i wanted to reference an int from another class how would i go about doing that???
public class Zoom extends View {
private Drawable image;
public int zoomControler=20;
public Zoom(Context context)
{
super(context);
image=context.getResources().getDrawable(R.drawable.icon);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.onDraw(canvas);
image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler, (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler);
image.draw(canvas);
}
}
class HelloOnTouchListener implements OnTouchListener{
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
return true;
}
}
in this case i want to reference the zoomControler from the first class in the second helloontouchlistener class