1

我正在使用Intents 从 Screen-A 调用 ZXing 扫描仪。扫描完成后,控制权当然会返回到 Screen-A 后面的代码,我在调用 Screen-B 之前做一些其他工作。

问题是:在此工作期间屏幕是黑色的,我无法确定用于显示“正在工作...”Toast/msgbox 的正确上下文。有什么帮助或建议吗?

4

2 回答 2

1

Execute your "work period" in it's own thread, while that thread works in the background Android will pass control to Screen-A which will can display a ProgressBar. The "work period" thread will pass Messages to Screen-A updating the value of a variable that measures progress. Here's a good place to start with Android threads:

http://developer.android.com/guide/appendix/faq/commontasks.html#threading

于 2009-05-03T20:19:12.007 回答
0

您不能ProgressDialog在调用 ZXing 之前显示 a 然后将其关闭onActivityResult()吗?

于 2009-04-22T21:21:40.883 回答