0
我創建了自己的ListView類(擴展了的TouchEvent檢測)的Android擴展的ListView
public class MyListView extends ListView{
private ScaleGestureDetector myScaleDetector;
private float myScaleFactor = 1.f;
public MyListView(Context context) {
super(context);
myScaleDetector = new ScaleGestureDetector(context, new myScaleListener());
}
@Override
public boolean onTouchEvent(MotionEvent e) {
myScaleDetector.onTouchEvent(e);
return super.onTouchEvent(e);
}
private class myScaleListener extends ScaleGestureDetector.
SimpleOnScaleGestureListener {
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
int a=3; //just for breakpoint
}
}
}
我這是怎麼佈局contacts_activity.xml
<com.my.aclient.ui.MyListView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/listView"/>
定義它,但應用也越來越上線的RuntimeException這個contacts_activity.xml文件被誇大
this.setContentView(R.layout.contacts_activity);
報告錯誤在logcat的堆棧跟蹤
二進制XML文件行#106:錯誤充氣類 com.my.aclient.ui.MyListView
當我只用ListView的一切完美的作品。什麼會造成這個問題?