Android:点击游戏对象上的事件

时间:2010-07-28 11:17:17

标签: android

我正在为Android创建游戏,我想在游戏中的某些游戏对象/图像上添加点击事件。问题是对象/图像是在线程中以编程方式创建的,所以我不知道如何向它们添加点击事件。我的代码结构如下所示:

- > main.xml中

- > Main.class

- > MainView.class

---> MainThread.class

对象是在MainThread类中创建的。我如何向他们添加点击事件?

我在MainThread类中创建这样的对象:

protected Bitmap image;
image = BitmapFactory.decodeResource(resources, resources.getIdentifier(filename, "drawable", "com.example.android.jetboy"));

0 个答案:

没有答案
相关问题