English 中文(简体)
冷 delay延迟/时间安排办法
原标题:Android delay / scheduling methods concern

我正在为安乐施发展游戏。

我的游戏是一种心脏游戏。 因此,我想的是,在我点击了一张卡后,我扔下了一张卡后,我希望大赦国际在两秒后开张。 因此,为了做到这一点,我想在我提出2点意见后,援引我的其中一种方法。

我对一些人进行了研究,发现安乐公司不支持安乐。 我使用了手工艺品,但我没有提供我想要的东西。 它一般但有时(几乎一半时间)不起作用,在我开了卡后开始立即回答。

因此,我想更笼统地问这个问题。 在我的情况中,究竟是怎样才能在安乐施(不是肯定的,而是几乎确切的)中做到这一点?

问题回答

AsynchTask是最佳选择,因为它将执行安排在ID thread上(只允许这一胎面与ID互动)。 或者,你可以read起新的read子,等待睡觉,并援引“OnUiThread()”。 这对你来说可能比较容易,但是如果你的游戏活动消失,你将不得不停止这种read。 (AsyncTask将自动这样做)





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签