Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 SUP 2.1.3 为 Android 开发应用程序。初始化时,应用程序将在服务器中注册并在服务器和设备之间建立连接。现在,当用户从设备上卸载应用程序时,必须删除这个注册的连接。
我的问题是:我可以通过应用程序本身来完成吗?
如果是,我该怎么做。根据我的研究,我可以理解在卸载时无法调用任何代码,因为我们使用 onDestroy() 或 onPause() 方法来执行此操作。
不,你不能。
当您卸载应用程序时,它的进程将被终止(如果它正在运行)并删除应用程序文件夹。为什么必须删除连接?
无论哪种方式,当检查用户是否在 SUP 上登录时,连接库只是从 SharedPreferences 文件返回一个布尔值。