由.apk安装的时候没有恢复状态的Andr​​oid应用程序,从工作精细日食 [英] Android application not restoring state when installed from .apk, works fine from eclipse

查看:153
本文介绍了由.apk安装的时候没有恢复状态的Andr​​oid应用程序,从工作精细日食的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是很奇怪:当我测试从安装Eclipse我的应用程序,它正在恢复它的状态就好了,比如它显示了正确的活动/屏幕,离开这个程序移动,然后再次点击该图标后。
当我从导出.apk文件安装完全相同的code这不起作用:应用程序回来空白,从登录屏幕。

This is very strange: when I test my app installed from Eclipse, it is restoring it's state just fine, eg it shows the correct activity/ screen after moving away from the app and then tapping the icon again. This does not work when I install the exact same code from an exported .apk file: the app comes back "blank", starting with the login screen.

这可能是什么原因?

推荐答案

当你点击在Eclipse运行按钮,它并不意味着应用程序被安装真的。这可能只是返回一个状态筛选。发生这种情况时,你不做出code的任何变化,因为上次运行。

When you click "run" button in Eclipse it does not means that application is really installed. It may just returns to screen in last state. This happens when you do not make any changes in code since last run.

当你真的(/ APK自/由亚行通过月食)Android首次站上安装的应用程序已经运行旧的应用程序,然后重新安装,并从一开始(在你的情况下登录屏幕)上运行。这是有效的行为,你不能改变它。

When you really install app (by eclipse / from apk / by adb) android first stops already running old app, then reinstall it and runs from very beginning (login screen in your case). It is valid behavior and you can not change it.

如果你有一些数据(如登录或密码),应通过安装或更新保存你应该使用的备份役。如果您安装的应用程序到另一个设备,它仍然工作。

If you have some data (eg logins or passwords), that should be saved through installs or updates you should use backup servie. It will work even if you install app to another device.

这篇关于由.apk安装的时候没有恢复状态的Andr​​oid应用程序,从工作精细日食的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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