Universal Image Loader with PhotoView : zoom crashes

626 Views Asked by At

When I zoom out an image too much, the app crashes.

LogCat:

*FATAL EXCEPTION MAIN:
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java.2153)*

What I have to do???

2

There are 2 best solutions below

0
On

If you have a problem in that case you can use bitmap rather than universal image loader.

Hope it helps

    ImageView bmImage;


    public DisplayImageFromURL(ImageView bmImage) 
    {
        this.bmImage = bmImage;
    }
    protected Bitmap doInBackground(String... urls) 
    {
        String urldisplay = urls[0];
        Bitmap mIcon11 = null;
        try 
        {
            InputStream in = new java.net.URL(urldisplay).openStream();
            mIcon11 = BitmapFactory.decodeStream(in);
        } 

        catch (Exception e) 
        {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }

        return mIcon11;

    }
    protected void onPostExecute(Bitmap result) {
        bmImage.setImageBitmap(result);
        //pd.dismiss();
    }
0
On

If you are using ViewPager, then replace it with HackyViewPager.