Buggy code:
_isFiltersSelected = ! ( _isFiltersSelected ) ; _isImagesSelected = false ; imageMove ( ( ( int ) ( buttonScrollYTo - ( buttonScroll . getY ( ) ) ) ) ) ; } break ; case id . imagesButton : { float buttonScrollYTo ; float filterScrollYTo ; float imageScrollYTo ; if ( _isFiltersSelected ) { filterScrollYTo = ( ( float ) ( windowheight ) ) ; ObjectAnimator filterListAnimator = ObjectAnimator . ofFloat ( filterList , "y" , filterList . getY ( ) , filterScrollYTo ) ; filterListAnimator . setDuration ( 500 ) ; filterListAnimator . start ( ) ; } if ( _isImagesSelected ) { buttonScrollYTo = ( ( float ) ( windowheight ) ) - ( buttonScroll . getHeight ( ) ) ; imageScrollYTo = ( ( float ) ( windowheight ) ) ; } else { buttonScrollYTo = ( ( ( float ) ( windowheight ) ) - ( buttonScroll . getHeight ( ) ) ) - ( imageList . getHeight ( ) ) ; if ( _isFiltersSelected ) { imageScrollYTo = ( ( float ) ( windowheight ) ) - ( imageList . getHeight ( ) ) ; } else { imageScrollYTo = ( ( float ) ( windowheight ) ) - ( imageList . getHeight ( ) ) ; } } ObjectAnimator buttonScrollAnimator = ObjectAnimator . ofFloat ( buttonScroll , "y" , buttonScroll . getY ( ) , buttonScrollYTo ) ; buttonScrollAnimator . setDuration ( 500 ) ; buttonScrollAnimator . start ( ) ; ObjectAnimator imagesListAnimator = ObjectAnimator . ofFloat ( imageList , "y" , imageList . getY ( ) , imageScrollYTo ) ; imagesListAnimator . setDuration ( 500 ) ; imagesListAnimator . start ( ) ; _isImagesSelected = ! ( _isImagesSelected ) ; _isFiltersSelected = false ; imageMove ( ( ( int ) ( buttonScrollYTo - ( buttonScroll . getY ( ) ) ) ) ) ; } break ; case id . noFilterButton : { Bitmap bmp = tempBitmap . copy ( tempBitmap . getConfig ( ) , true ) ; image . setImageBitmap ( bmp ) ; originalBitmap = bmp ; for ( int i = 0 ; i < ( images . size ( ) ) ; i ++ ) { images . get ( i ) . setImageBitmap ( null ) ; images . get ( i ) . setImageDrawable ( imageOrigContents . get ( i ) ) ; } } break ; case id . filterButton1 : case id . filterButton2 : case id . filterButton3 : case id . filterButton4 : case id . filterButton5 : case id . filterButton6 : case id . filterButton7 : { Bitmap bmp = originalBitmap . copy ( tempBitmap . getConfig ( ) , true ) ; NativeUtils nativeUtils = new NativeUtils ( ) ; long stamp = System . nanoTime ( ) ; nativeUtils . blend ( bmp , filterMap . get ( v . getId ( ) ) ) ; Log . d ( "VISION" , ( "Time:<seq2seq4repair_space>" + ( ( System . nanoTime ( ) ) - stamp ) ) ) ; image . setImageBitmap ( bmp ) ; for ( int i = 0 ; i < ( images . size ( ) ) ; i ++ ) { images . get ( i ) . buildDrawingCache ( ) ; Bitmap curBitmap = ( ( android . graphics . drawable . BitmapDrawable ) ( imageOrigContents . get ( i ) ) ) . getBitmap ( ) ; <START_BUG> Bitmap grayBitmap = curBitmap . copy ( curBitmap . getConfig ( ) , true ) ; <END_BUG> curBitmap = null ; nativeUtils . blend ( grayBitmap , filterMap . get ( v . getId ( ) ) ) ; images . get ( i ) . setImageResource ( transparent ) ; images . get ( i ) . destroyDrawingCache ( ) ; images . get ( i ) . setImageBitmap ( grayBitmap ) ; } } break ; case id . image1Button : case id . image2Button : case id . image3Button : case id . image4Button : case id . image5Button : case id . image6Button : case id . image7Button : case id . image8Button : case id . image9Button : case id . image10Button : case id . image11Button : case id . image12Button : case id . image13Button : case id . image14Button : case id . image15Button : case id . image16Button : case id . image17Button : case id . image18Button : case id . image19Button : case id . image20Button : case id . image21Button : case id . image22Button : case id . image23Button : case id . image24Button : case id . image25Button : case id . image26Button : case id . image27Button : case id . image28Button : case id . image29Button : case id . image30Button : case id . image31Button : case id . image32Button : case id . image33Button : case id . image34Button : case id . image35Button : case id . image36Button : case id . image37Button : { ImageView newImage = new ImageView ( this ) ; newImage . setImageResource ( imageMap . get ( v . getId ( ) ) ) ; newImage . setLayoutParams ( new FrameLayout . LayoutParams ( LayoutParams . WRAP_CONTENT , LayoutParams . WRAP_CONTENT ) ) ; FrameLayout layout = ( ( FrameLayout ) ( findViewById ( GalleryLayout ) ) ) ; newImage . setOnTouchListener ( this ) ; newImage . setAdjustViewBounds ( false ) ; images . add ( newImage ) ; imageOrigContents . add ( newImage . getDrawable ( ) ) ; layout . addView ( newImage ) ; findViewById ( SaveButton ) . bringToFront ( ) ; findViewById ( funcScroll ) . bringToFront ( ) ; findViewById ( filterView ) . bringToFront ( ) ; findViewById ( imageScrollView ) . bringToFront ( ) ; text . bringToFront ( ) ; } break ; } } private void imageMove ( int delta ) { }

Fix:
Bitmap grayBitmap = curBitmap . copy ( ARGB_8888 , true ) ;