I have an array named Floors in class A, it contains values something like the following:
List<Point> manualpoint = new ArrayList<Point>();
int[] manualpointx = {135,200,300,155,235,300};
Let’s say I wish to pass these values to class B, supposingly class B has already declared a superclass View
public class DrawView extends View implements OnTouchListener {
@Override
public void onDraw(Canvas canvas) {
//pass the values into this class
}
}
How do i pass the values from class A to B?
You can do something like this.
If you need only non-static fields in your class
Aand if you just want to use non-static methods, you will have to access them via an instance of the classAfrom your classDrawView.