且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何储存使用后启动时,prevent应用程序重新启动?

更新时间:2022-11-06 16:33:05

这更像是一种解决方法,您的问题,但似乎有可能没有真正解决问题。

This is more like a workaround to your problem, but it seems that there may be no real solution.

我的第一个念头是 - 因为整个安装程序将需要一段时间呢 - 你为什么不只是某种书签('firstLaunch')的保存到preferences,发布(延迟?)的通知,并完成应用程序,从而使用户必须通过点击启动程序图标再次打开它。只有这样,你开始真正的设置,这样你就不会丢失信息由于安装VS启动的问题。

My first thought was - since the whole setup will take a while anyway - why don't you just save some kind of bookmark ('firstLaunch') to Preferences, post a (delayed?) notification and finish the app, so that the user has to open it again by tapping on the launcher icon. Only then you start the real setup, so you will not lose information due to the installer vs launcher problem.

但这个问题似乎已经存在了一段时间,下面的SO-的帖子可能会有所帮助:

But the problem seems to have been around for some time and the following SO-posts may help:

Re-launch活动的Home键,不过......只有第一次的

After轻触应用程序图标,启动再与功放营造根系活力的新实例;一次

希望这有助于!