如何在Android的处理来电后恢复从previous状态的活动? [英] How to Resume Activity from Previous state after handling Incoming Call in Android?

查看:113
本文介绍了如何在Android的处理来电后恢复从previous状态的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的应用程序,从服务器下载和显示图像4-5的画廊。
它在正常条件下工作的罚款。但是,当有来电或设备处于休眠模式下,从onResume之后开始我的活动负载数据,我不能够加载从活动previous状态数据(恢复活动)。

I am creating app that download 4-5 images from server and display as gallery. It working fine in normal condition. but when there is incoming call or device is in sleep mode my activity load data from starting after onResume, i am not able to load data(Resume activity) from previous state of activity.

有没有soulution?

Is there any soulution?

感谢

推荐答案

您应该阅读如何的处理运行时更改

基本上,在某些情况下,你的活动将重新创建。以preserve状态,你可以通过新旧活动之间的物体,使用的onSaveInstanceState()在老年活动和 onRestoreInstanceState()在新的活动。

Basically, under some situations your Activity will be recreated. To preserve state you can pass objects between old and new Activity, using onSaveInstanceState() in old activity and onRestoreInstanceState() in new activity.

这篇关于如何在Android的处理来电后恢复从previous状态的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆