如何在加载所有图像之前加载活动?
我已经为这个问题苦苦挣扎很多天了。请帮助我..
在我的android应用程序中,我试图从远程服务器动态下载图像(没有动态的图像)。下载所有图像需要 30 到 40 秒,平均用户必须等待才能看到活动。但最坏的情况是加载所有图像后加载 Activity。我想先加载活动,然后一张一张地加载图像。
有什么可以做的吗?
谢谢和问候,
基兰
I have been struggling with this problem for many days. please help me..
In my android application i am trying to download images from remote server dynamically ( no of images dynamically come ). for downloading all images it is taking 30 to 40 seconds mean time user has to wait to see the activity . But it is the worst case that loading activity after loading all images. I want to load activity first then load images one by one.
Is there anything to do it?
Thanks and Regards,
Kiran
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要使用“AsyncTask”来实现您的代码,有关更多信息,请参阅此链接: http://developer.android.com/reference/android/os/AsyncTask.html
例如:
参见上面的示例,在“doInBackground()”函数中编写下载图像的代码并编写代码用于在“onPostExecute()”函数内显示图像。
享受!!
I think you need to implemet your code using "AsyncTask", for more info, refer this link: http://developer.android.com/reference/android/os/AsyncTask.html
for example:
See in above example, Write your code for downloading images inside "doInBackground()" function and write the code for displaying iamges inside "onPostExecute()" function.
Enjoy!!