是在一个自定义轮滑的viewpager里的dispatchTouchEvent里写的toast。
public boolean dispatchTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
stopScroll();
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
if((ev.getEventTime()-ev.getDownTime())<100)
{
Toast.makeText(context, getCurrentItem(), 0).show();//这里出错
}
startScroll();
break;
default:
break;
}
return super.dispatchTouchEvent(ev);
}
错误信息:
03-26 10:31:20.445: W/ResourceType(6672): No package identifier when getting value for resource number 0x00000001
03-26 10:31:20.445: E/InputEventReceiver(6672): Exception dispatching input event.
03-26 10:31:20.445: E/MessageQueue-JNI(6672): Exception in MessageQueue callback: handleReceiveCallback
03-26 10:31:20.449: E/MessageQueue-JNI(6672): android.content.res.Resources$NotFoundException: String resource ID #0x1
03-26 10:31:20.449: E/MessageQueue-JNI(6672): at android.content.res.Resources.getText(Resources.java:244)
03-26 10:31:20.449: E/MessageQueue-JNI(6672): at android.widget.Toast.makeText(Toast.java:268)
03-26 10:31:20.449: E/MessageQueue-JNI(6672): at com.example.baby.widget.AutoScrollViewPager.dispatchTouchEvent(AutoScrollViewPager.java:82)
03-26 10:31:20.449: E/MessageQueue-JNI(6672): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)