Search

CN-122019251-A - Method, device, computer program and electronic equipment for managing application

CN122019251ACN 122019251 ACN122019251 ACN 122019251ACN-122019251-A

Abstract

The technical field of computer software, more particularly, relates to a method for managing an application, wherein the method comprises the steps of responding to a recovery request of a target page of the application, determining whether a memory recovery mark of the application is in a first state, wherein the initial state of the memory recovery mark is in the first state, responding to the determination that the memory recovery mark of the application is in the first state, entering a starting page of the application, and responding to the creation of the starting page of the application, and setting the memory recovery mark to be in a second state. According to the invention, whether the memory is recovered or not is monitored through the applied memory recovery mark, and when the memory is recovered, the page is jumped, such as the starting page, so that the abnormal application is avoided.

Inventors

  • Lei Lifu
  • WANG GUOLIN
  • XU ZHANGMING
  • REN FUJIA

Assignees

  • 杭州老板电器股份有限公司

Dates

Publication Date
20260512
Application Date
20241104

Claims (10)

  1. 1. A method for managing applications, comprising: Responding to a recovery request of a target page of an application, and determining whether a memory recovery mark of the application is in a first state, wherein the initial state of the content recovery mark is in the first state; entering a start page of the application in response to determining that the memory reclamation flag of the application is in a first state, and And setting the memory reclamation mark to a second state in response to the creation of the starting page of the application.
  2. 2. The method for managing an application of claim 1, further comprising: storing page data of the target page in a memory reclamation operation for the application, and The creating of the starting page comprises the following steps: acquiring page data of the target page, and And carrying out data recovery of the target page based on the acquired page data.
  3. 3. The method for managing an application of claim 1, further comprising: storing page data of the target page in a memory reclamation operation for the application, and The creating of the starting page comprises the following steps: acquiring page data of the target page, and And carrying out control state recovery of the target page based on the acquired page data.
  4. 4. The method for managing an application of claim 2, wherein the page data includes at least one of configuration data and user preference data; the storing of the page data comprises: saving the configuration data and the user preference data to corresponding SHAREDPREFERENCE objects, and The acquiring of the page data comprises the following steps: and acquiring the configuration data and the user preference data from the corresponding SHAREDPREFERENCE objects.
  5. 5. The method for managing an application of claim 2, wherein the page data includes at least one of user information and a user order record; the storing of the page data comprises: saving the user information and the user order record to corresponding database objects, and The acquiring of the page data comprises the following steps: and acquiring the user information and the user order from the corresponding database object.
  6. 6. The method for managing an application of claim 2, wherein the page data includes at least one of text data and binary data; the storing of the page data comprises: saving the text data and the binary data to corresponding file objects, and The acquiring of the page data comprises the following steps: And acquiring the text data and the binary data from the corresponding file object.
  7. 7. The method for managing an application of claim 3, wherein the control state comprises at least one of a text entry box state, a switch state, a selector state, a progress bar state, a list diagram state, a slider state, and a multi-box state; The saving of the control state comprises the following steps: Saving the text input box state, the switch state, the selector state, the progress bar state, the list diagram state, the slider state, and the multi-box state to a corresponding SHAREDPREFERENCE object; The acquiring of the control state comprises the following steps: the text input box state, the switch state, the selector state, the progress bar state, the list diagram state, the slider state, and the multi-box state are obtained from the corresponding SHAREDPREFERENCE objects.
  8. 8. An apparatus for managing applications, comprising: The page recovery module is used for responding to a recovery request of a target page of an application and determining whether a memory recovery mark of the application is in a first state or not, wherein the initial state of the content recovery mark is in the first state; a memory reclamation judging module for responding to the determination that the memory reclamation mark of the application is in a first state, entering a starting page of the application, and And the starting page module responds to the creation of the starting page of the application and sets the memory reclamation mark to a second state.
  9. 9. A computer application program product comprising a first program product, characterized by comprising the following steps: Computer program which, when executed by a processor, implements the steps of the method of any of claims 1-7.
  10. 10. An electronic device, comprising: one or more processors, and A memory associated with the one or more processors for storing program instructions that, when read for execution by the one or more processors, perform the steps of the method of any of claims 1-7.

Description

Method, device, computer program and electronic equipment for managing application Technical Field The present invention relates to the technical field of computer software, and more particularly to a method for managing applications. Background The Android (Android) system may cause system blocking due to memory reasons in the use process, and related system memory management mechanisms can recover memory of an application running in the background, so that when the application is opened again, null pointer abnormality is caused. Such anomalies not only affect the user experience, but may also cause the application to crash. Disclosure of Invention The embodiment of the disclosure aims to solve the problem of null pointer exception caused by memory reclamation in the prior art. A method for managing application is provided, which monitors whether the memory is recovered or not through the memory recovery mark of the application, and jumps to e.g. a starting page when the memory is recovered, thereby avoiding abnormal application. In a first aspect of embodiments of the present disclosure, a method for managing an application is provided, the method including determining whether a memory reclamation flag of the application is in a first state in response to a restoration request of a target page of the application, wherein an initial state of the memory reclamation flag is the first state, entering a start page of the application in response to determining that the memory reclamation flag of the application is in the first state, and setting the memory reclamation flag to a second state in response to creation of the start page of the application. Preferably, the method further comprises the steps of storing page data of the target page in a memory reclamation operation aiming at the application, starting the creation of the page, acquiring the page data of the target page, and carrying out data restoration of the target page based on the acquired page data. Preferably, the method further comprises the steps of storing page data of the target page in a memory reclamation operation aiming at the application, starting the creation of the page, acquiring the page data of the target page, and recovering the control state of the target page based on the acquired page data. Further preferably, wherein the page data comprises at least one of configuration data and user preference data, the saving of the page data comprises saving the configuration data and the user preference data to a corresponding SHAREDPREFERENCE object, and the acquiring of the page data comprises acquiring the configuration data and the user preference data from a corresponding SHAREDPREFERENCE object. Further preferably, wherein the page data comprises at least one of user information and a user order record, the saving of the page data comprises saving the user information and the user order record to corresponding database objects, and the acquiring of the page data comprises acquiring the user information and the user order from the corresponding database objects. Further preferably, wherein the page data comprises at least one of text data and binary data, the saving of the page data comprises saving the text data and binary data to corresponding file objects, and the acquiring of the page data comprises acquiring the text data and binary data from the corresponding file objects. Further preferably, the control state comprises at least one of a text input box state, a switch state, a selector state, a progress bar state, a list diagram state, a slider state and a multi-box state, the saving of the control state comprises saving the text input box state, the switch state, the selector state, the progress bar state, the list diagram state, the slider state and the multi-box state to corresponding SHAREDPREFERENCE objects, and the acquiring of the control state comprises acquiring the text input box state, the switch state, the selector state, the progress bar state, the list diagram state, the slider state and the multi-box state from corresponding SHAREDPREFERENCE objects. In a second aspect of the embodiments of the present disclosure, an apparatus for managing an application is provided, including a page restoration module that determines whether a memory reclamation flag of the application is in a first state in response to a restoration request of a target page of the application, wherein an initial state of a content reclamation flag is in the first state, a memory reclamation judging module that enters a start page of the application in response to determining that the memory reclamation flag of the application is in the first state, and a start page module that sets the memory reclamation flag to a second state in response to creation of the start page of the application. In a third aspect of embodiments of the present disclosure, there is provided a computer application program product comprising a computer program which, when exe