如何在Android中销毁触摸的Bitmap对象?

时间:2022-06-12 03:50:28

I am very new to Android programming, so I hope I make sense. I have a number of Bitmap objects that I would like to erase upon touch, and draw something else. What would be the best way to do it? I was originally thinking to destroy the object, but it may be redundant if I will be drawing another object anyways. Looking for a point in the right direction :)

我是Android编程的新手,所以我希望我有意义。我有一些Bitmap对象,我想在触摸时擦除,并绘制其他东西。最好的方法是什么?我本来想破坏这个物体,但是如果我要画另一个物体,那可能是多余的。寻找正确方向的一点:)

1 个解决方案

#1


0  

You could use the Gallery (Tutorial) layout to display your objects. Then use onItemClick (AdapterView<?> parent, View view, int position, long id) as event for replacing the object.

您可以使用图库(教程)布局来显示对象。然后使用onItemClick(AdapterView parent,View视图,int position,long id)作为替换对象的事件。

#1


0  

You could use the Gallery (Tutorial) layout to display your objects. Then use onItemClick (AdapterView<?> parent, View view, int position, long id) as event for replacing the object.

您可以使用图库(教程)布局来显示对象。然后使用onItemClick(AdapterView parent,View视图,int position,long id)作为替换对象的事件。