ArrayIndexOutOfBoundsException in PhotoView + ViewPager
It seems to be a bug some where along the lines. I'm not sure if it is on the PhotoViewer side or on androids side. I worked around this issue by using this code in my own custom view pager:
public class HackyViewPager extends ViewPager {
public HackyViewPager(Context context)
{
super(context);
}
public HackyViewPager(Context context, AttributeSet attrs)
{
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
try
{
return super.onInterceptTouchEvent(ev);
}
catch (IllegalArgumentException e)
{
}
catch (ArrayIndexOutOfBoundsException e)
{
}
return false;
}
}
I've had no issues using this code and zooming in and zooming out seems to work fine. Create this class in your source code and then you can reference it in your xml files like this:
<my.default.package.HackyViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>