I use the remove() function in this context:

 Singelton.getInstanse().getArrayBitmap().get(position).remove(); 

But the remove() method is not recognized.
What method should I use to remove an object from an array cell?

  • one
    The remove method in ArrayList is implemented in two forms. There you need to pass either the index of the element (will delete the element at the specified place), or the object (will delete the found object with the lowest index) - LEQADA
  • You are trying to call the remove method on the Bitmap object itself, which it does not have. - temq

3 answers 3

 Singelton.getInstanse().getArrayBitmap().remove(position); 
     ArrayList<Bitmap> bmArrayList = Singelton.getInstanse().getArrayBitmap(); Bitmap bitmap = Singelton.getInstanse().getArrayBitmap().get(position); bmArrayList.remove(bitmap); 

    So try

      Try a method inside Singletone to write

        public final class Singleton { private static ArrayList<Bitmap> bitmapArray; /** Single ton constructor. */ private Singleton() { } public static void removeByPosition(int position) { bitmapArray.remove(position); } }