有没有办法以编程方式捕捉清除数据操作的应用程序吗?没有办法、应用程序、操作、方式

2023-09-05 05:07:38 作者:壆人喜悲

我公司开发的一款使用Android操作系统的应用程序由具有套活动和一个后台服务运行。我保持了一些应用数据到设备的内存中,所以当用户点击了设置 - >应用程序 - 清除数据选项>清除数据按钮,保存在内存中的所有数据将被清除。 我要拍摄的清除数据单击事件或动作(如果有可用的),当用户点击我的应用程序的服务,或在广播接收器类清除数据按钮,任何人都可以认为是没有根据点击应用程序中清除数据引发的设备的任何行动所以我能赶上我的应用程序广播接收器类中的动作和完成所需任务???

请为我提供一些示例的分辨率。

问候, 皮克斯

解决方案   

我要拍摄的清除数据单击事件或动作(如果有可用的),当用户点击我的应用程序的服务,或在广播接收器类清除数据按钮,任何人都可以认为是没有根据点击清除抛出设备的任何行动应用程序的数据,以便我能赶上我的应用程序广播接收器类中的动作和完成所需任务???

有没有。 AFAIK,pressing清除数据也停止你的流程,让您的code将不会运行。你会像对待用户pressing清除数据为相同的地方,用户安装了您的应用程序在第一次的情况。

I developed one android app which is having sets of activities and one background service running. I am keeping some app data to the device's internal memory so when users clicks on Clear Data option from Settings->Applications-> Clear Data button, all data saved in internal memory gets cleared. I have to captured Clear Data click event or action(if any available) when user clicks on Clear Data button in my App's service OR in broadcast receiver class, can anyone suggest that is there any action thrown by device upon clicking on Clear data of app so I could catch that action in my app broadcast receiver class and perform desired task???

VIVO手机怎么清除信息情况使用数据

Please provide me the resolution with some example.

Regards, Piks

解决方案

I have to captured Clear Data click event or action(if any available) when user clicks on Clear Data button in my App's service OR in broadcast receiver class, can anyone suggest that is there any action thrown by device upon clicking on Clear data of app so I could catch that action in my app broadcast receiver class and perform desired task???

There is none. AFAIK, pressing Clear Data also stops your process, so your code will not be running. You would treat the user pressing Clear Data as being identical to the case where the user installed your app for the very first time.