AsyncTask onPostExecute() 太慢
我正在使用 AsyncTask 来分析一些数据并保持 UI 顺利运行。 然而,返回值需要很长时间才能返回。
事件: 一个球穿过屏幕。在 x 点,进行了大量分析。我希望球根据 x 点的计算而改变颜色。在测试中,球在 x 点之后大约一秒(或更短时间)改变颜色。
我目前从中得到结果:
@Override
protected void onPostExecute(Boolean result) {
MotionView.hitCorrectNote = result;
}
Can I not return a value from the method:
protected Boolean doInBackground(String... var)
Sure I can if it is type Boolean?
关于如何加快速度的任何其他建议将受到欢迎。
谢谢
I am using AsyncTask to analyse some data and keep the UI running smoothly.
However, the return value takes way too long to come back.
Event:
A ball goes across the screen. at point x there is a lot of analysis done. i would like the ball to change colour as a result of point x's calculations. In testing the ball changes colour about a second (or just less) after point x.
I currently get my result back from this:
@Override
protected void onPostExecute(Boolean result) {
MotionView.hitCorrectNote = result;
}
Can I not return a value from the method:
protected Boolean doInBackground(String... var)
surely I can if it is type Boolean?
Any other suggestions about how to speed this up would be welcome.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论