【发布时间】:2014-03-19 16:05:19
【问题描述】:
我定义了一个扩展类 View 的自定义视图。
public class MyView extends View{
public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
Matrix m= new Matrix();
//this line is ok
m.setScale(...);
}
public boolean onTouchEvent(MotionEvent event){
//this same operation throws "IllegalStateException: Matrix can not be modified"
m.setScale(...);
}
}
我想知道为什么我会遇到这样的异常。我在网上搜索但根本找不到任何线索。
【问题讨论】:
标签: android matrix illegalstateexception