码迷,mamicode.com
首页 > 编程语言 > 详细

解决多指操作放大缩小 指针错误 java.lang.IllegalArgumentException: pointerIndex out of range

时间:2014-09-03 12:55:26      阅读:313      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   color   io   java   ar   div   sp   

/** Custom your own ViewPager to extends support ViewPager. java source: */
/** Created by azi on 2013-6-21.  */

package com.chaokuadi.android.support.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class ViewPagerFixed extends android.support.v4.view.ViewPager {

    public ViewPagerFixed(Context context) {
        super(context);
    }

    public ViewPagerFixed(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        try {
            return super.onTouchEvent(ev);
        } catch (IllegalArgumentException ex) {
            ex.printStackTrace();
        }
        return false;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        try {
            return super.onInterceptTouchEvent(ev);
        } catch (IllegalArgumentException ex) {
            ex.printStackTrace();
        }
        return false;
    }
}


IllegalArgumentException (pointerIndex out of range) while using many fingers to zoom in and out

解决多指操作放大缩小 指针错误 java.lang.IllegalArgumentException: pointerIndex out of range

标签:android   style   blog   color   io   java   ar   div   sp   

原文地址:http://www.cnblogs.com/niray/p/3953227.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!