我在其中一个al类中声明如下
ArrayList<Line> Line1 = wl.point;
ArrayList<Line> Line2 = new ArrayList<Line>();
wl中定义了point的值。
al主要是把Line1的值通过算法赋值给了Line2; 然后我在MainActivity中声明如下
ArrayList<Line> BestPoint = new ArrayList<Line>();
al d = new al();
方法中赋值如下
d.wrap(string 1, string 2);//完成算法的
BestPoint = d.Line2;
GeoPoint[] p = new GeoPoint[BestPoint.size()];
然后对p进行赋值(java程序测试成功了,能正确得到p的值,android上测试总是错误的,如果我单独对BestPoint赋值的话也是可以的,所以我觉得是BestPoint = d.Line2;无法赋值上去)
然后错误提示java.lang.ArrayIndexOutOfBoundsException 为什么无法赋值上啊?求大神解释下啊