Display method, readable medium, and electronic device

By detecting and managing the status attributes of the display interface in electronic devices, the user interface jump problem caused by interface refresh in column display mode is solved, and the user experience is improved.

CN119276970BActive Publication Date: 2025-08-22HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410004204.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2025-08-22
Estimated Expiration
2044-01-02

AI Technical Summary

Technical Problem

In electronic devices such as foldable phones, when the interface of the same application is refreshed in the column display mode, the user interface may suddenly jump, affecting the user's visual experience.

Method used

By detecting the status attributes of the display interface running in the electronic device, determine the foreground and background interfaces, and when a refresh event is detected, directly refresh the interface displayed in the foreground to avoid abnormal jumps.

Benefits of technology

Improves the stability of the user interface, avoids sudden jumps in the interface, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276970B_ABST
    Figure CN119276970B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electronic devices and discloses a display method, a readable medium, and an electronic device. The display method in the present application includes: detecting a refresh event for a display interface of a first application, detecting a foreground display interface and a background display interface on which the first application is currently running, determining that the foreground display interface is an interface to be refreshed, and refreshing the foreground display interface. Through the display of the present application, abnormal interface refresh jumps when the foreground display interface and the background display interface of the first application are running can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic devices, and in particular to a display method, a readable medium, and an electronic device. Background Art

[0002] Currently, some electronic devices (e.g., tablets, foldable phones, etc.) can support application programs (APPs) in a split-column display mode. In this mode, the electronic device can display two or more application interfaces of the same application or different applications side by side.

[0003] For example, Figure 1a As shown, the foldable phone 10 can display the interface 11 of the setting application and the interface 12 of the software update application in two different display bars. Figure 1b As shown, if the user interface displays the latest received notification message 13 of the software update application, the user can click on the notification message 13 to open the full screen as shown in FIG. Figure 1c The software update application interface 14 is shown. At this time, the settings application interface 11 and the software update application interface 12 displayed in the columns will return to the background to run.

[0004] In some cases, the foldable phone's system may refresh the display interface of the software update application for some reason. At this time, because the software update application runs two interfaces simultaneously, namely the full-screen interface 14 and the background-running column-displayed interface 12, the background-running column-displayed interface 12 may be refreshed, causing the display screen to suddenly jump from the full-screen update application interface 14 to the column-displayed interface 12, affecting the user's viewing experience. Summary of the Invention

[0005] The purpose of this application is to provide a display method, a readable medium and an electronic device.

[0006] A first aspect of the present application provides a display method, which is applied to an electronic device, and the method includes: detecting a first refresh event for a display interface of a first application, and detecting a first display interface and a second display interface on which the first application is currently running; obtaining status attributes of the first display interface and the second display interface; based on the status attributes of the first display interface and the second display interface, determining that the first display interface is displayed in the background and the second display interface is displayed in the foreground; determining the second display interface as the interface to be refreshed, and refreshing the second display interface in response to the first refresh event.

[0007] In an embodiment of the present application, the first refresh event may be an interface refresh event obtained by the electronic device system side, such as a failure to download a new version; the first application may be a software update application; the first display interface and the second display interface may be the same display interface of the first application, such as a new version interface.

[0008] It can be understood that when a refresh event is detected, if it is detected that a second display interface corresponding to the refresh event is already displayed in the foreground, the second display interface displayed in the foreground will be refreshed directly, and there will be no abnormal jump of the user interface, thereby improving the user experience.

[0009] In a possible implementation of the first aspect above, the state attribute includes at least one of the following: whether to display in the foreground, whether to display in columns, whether to display in floating mode, and whether to display in full screen mode.

[0010] In one possible implementation of the first aspect above, the state attributes of the first display interface include column display, and the state attributes of the second display interface include full-screen display; or the state attributes of the first display interface include full-screen display, and the state attributes of the second display interface include column display.

[0011] In one possible implementation of the first aspect above, the method further includes: detecting a first operation of displaying a first display interface, displaying the first display interface; detecting a second operation of displaying a second display interface, displaying the second display interface, and running the first display interface in the background.

[0012] In one possible implementation of the first aspect above, the method also includes: detecting a first operation of displaying a first display interface, generating and storing a first display component instance and first state attribute information of the first display interface, wherein the first state attribute information includes foreground display information; detecting a second operation of displaying a second display interface, generating a second display component instance and second state attribute information of the second display interface, wherein the second state attribute information includes foreground display information, and the first display component instance and the second display component instance are the same.

[0013] In an embodiment of the present application, the first operation may be an operation of displaying the first display interface, the first display component instance may be an Activity instance corresponding to the first display interface, the first state attribute information may be a state attribute corresponding to the first display interface, the second operation may be an operation of displaying the second display interface, the second display component instance may be an Activity instance corresponding to the second display interface, the second state attribute information may be a state attribute corresponding to the first display interface, and the foreground display information may be a foreground attribute.

[0014] In one possible implementation of the first aspect above, the method also includes: corresponding to detecting a second operation of displaying a second display interface and running the first display interface in the background, updating the first state attribute information of the first display interface to third state attribute information, the third state attribute information including background display information.

[0015] In the embodiment of the present application, the third state attribute information may be a state attribute corresponding to the first display interface, and the platform display information may be a background attribute.

[0016] In one possible implementation of the first aspect above, detecting the first display interface and the second display interface on which the first application is currently running includes: detecting the same first display component instance and second display component instance, and determining the first display interface and the second display interface on which the first application is currently running.

[0017] In a possible implementation of the first aspect above, based on the status attributes of the first display interface and the second display interface, it is determined that the first display interface is displayed in the background and the second display interface is displayed in the foreground, including: based on the third status attribute information of the first display interface, determining that the first display interface is displayed in the background; based on the second status attribute information of the second display interface, determining that the second display interface is displayed in the foreground.

[0018] In one possible implementation of the first aspect above, refreshing the second display interface in response to the first refresh event includes: sending a refresh message to the second display component through the refresh callback interface; and the second display component instance refreshing the second display interface based on the refresh message.

[0019] In one possible implementation of the first aspect above, corresponding to the first display interface state attributes including column display, the second display interface state attributes including full-screen display, and the second display interface being refreshed corresponding to the first refresh event, it also includes: starting the second display component instance corresponding to the second display interface by starting the display component; the second display component instance refreshes the second display interface in response to the start operation.

[0020] In an embodiment of the present application, the method for starting the display component may be the startActivity method.

[0021] A second aspect of the present application provides a readable medium having instructions stored thereon, which, when executed on an electronic device, causes the electronic device to execute any one of the methods described in the first aspect.

[0022] The third aspect of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, which is one of the processors of the electronic device, for executing the instructions stored in the memory to implement any one of the methods in the above-mentioned first aspect.

[0023] A fourth aspect of the present application provides a program product, which includes instructions. When the instructions are executed by an electronic device, the electronic device can implement any one of the methods in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1a According to an embodiment of the present application, a schematic diagram of a foldable mobile phone is shown in which a settings application interface and a software update application interface are displayed in two different display bars respectively;

[0026] Figure 1b According to an embodiment of the present application, a schematic diagram of a notification message of a software update application is shown;

[0027] Figure 1c According to an embodiment of the present application, a schematic diagram of an interface of a software update application is shown;

[0028] Figures 2a to 2k According to an embodiment of the present application, a schematic diagram of interface changes in a scenario of abnormal interface jump is shown;

[0029] Figure 2l According to an embodiment of the present application, a schematic diagram of a system notification box is shown;

[0030] Figures 3a to 3i According to an embodiment of the present application, a schematic diagram of changes in the activity of an electronic device during an interface change is shown;

[0031] Figure 4a According to an embodiment of the present application, a schematic diagram of a user interface for a pop-up window prompt is shown;

[0032] Figure 4b According to an embodiment of the present application, a flow chart of a display method is shown;

[0033] Figure 5According to an embodiment of the present application, a flow chart of another display method is shown;

[0034] Figure 6 According to an embodiment of the present application, a schematic diagram of a new version interface of a software update application is shown;

[0035] Figure 7 According to an embodiment of the present application, a structural schematic diagram of an electronic device is shown;

[0036] Figure 8 According to an embodiment of the present application, a software structure block diagram of an electronic device is shown. DETAILED DESCRIPTION

[0037] Illustrative embodiments of the present application include, but are not limited to, a display method, a readable medium, and an electronic device.

[0038] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and comprehensively described below with reference to the accompanying drawings.

[0039] It can be understood that for the sake of convenience of description, in the embodiment of the present application, the interface displayed in the foreground is called the foreground interface, the interface running in the background (that is, the interface that has not been destroyed or cleared) is called the background interface, the interface displayed in full screen is called the full-screen interface, and the interface displayed in column mode is called the column interface.

[0040] As previously mentioned, when an electronic device runs the same application interface in both the foreground and background, refreshing the application's display interface may cause a page jump. This issue is understandably related to the same application display interface having the same Activity (as an example of a display component) name, as described in detail below.

[0041] This application does not limit the specific form of the electronic device; the electronic device may be any device that supports a split-column display function. For example, the electronic device may be a foldable phone, a laptop computer, a tablet computer, a large-screen device, a wearable device (e.g., a watch, smart glasses, a helmet), a desktop computer, an augmented reality (AR) / virtual reality (VR) device, a personal digital assistant (PDA), etc. The following uses a foldable phone as an example of an electronic device.

[0042] Let's combine Figures 2a to 2k The following figure shows the interface changes in the abnormal interface jump scenario, which details the above interface jump problem.

[0043] Figure 2aAccording to an embodiment of the present application, a global search interface 20a of an electronic device 100 is shown. This interface 20a includes a search box 201. Furthermore, in response to a user inputting and searching for "software update" in the search box 201 via an input method application, this interface 20a also includes a quick entry for online searching for "software update" provided by a browser application, as well as on-device search results. The search results include, among other things, an entry 2011 for the software update application.

[0044] like Figure 2a As shown, in response to the user clicking on the entry 2011 of the software update application, the electronic device 100 opens the software update application (or OUC) and displays the following information: Figure 2b The software update application main interface 20b shown in FIG. Figure 2b As shown, the user interface 20b includes a prompt text message of "Checking...", the version number of the new version, the version number of the current version, and a "Check for Updates" control 202. It can be understood that since the "Check for Updates" control 202 is already in a non-clickable state, since it is already checking whether there is a new version.

[0045] After the software update application detects a new version of the system software, it will display the following Figure 2c The new version interface 20c of the software update application is shown. Figure 2c As shown, the user interface 20 c includes the version information of the new version, an “update log” display box, and a “download and install” control 203 .

[0046] For example, if the user does not want to download the new version of the installation package at this time, they can swipe up to return to the desktop user interface. At this time, the software update application switches from the foreground display state to the background. If the user wants to update the system software while the software update application is running in the background, they can update the system software from the settings application.

[0047] like Figure 2d As shown, the user clicks the icon 204 of the settings application in the user interface 20d to open the settings application. It can be understood that the user interface 20d includes application icons of multiple applications, such as a settings application, a clock application, a browser application, etc. In response to the user clicking the icon 204 of the settings application, the electronic device 100 displays the following Figure 2e The user interface 20e of the settings application is shown. Figure 2e As shown, the user interface 20e includes a settings item list interface 205 (one of the display interfaces of the settings application). The settings item list interface 205 includes buttons for various settings items, such as controls for battery, storage, security, privacy, healthy phone usage, smart assistant, foldable screen area, auxiliary functions, users and accounts, system and updates, etc.

[0048] Continue to refer Figure 2e When the user clicks the system and update control on the setting item list interface 205, the electronic device displays the following Figure 2f The user interface 20f shown. Figure 2f As shown, the user interface 20f includes a settings item list interface 205 and a system and update interface 206 (one of the display interfaces for the settings application). The system and update interface 206 includes a "Software Update" control 2061, which is the entry point for launching the software update application. That is, when a user clicks the "Software Update" control 2061, the software update application is launched.

[0049] Specifically, when the user clicks the "Software Update" control 2061, the reference Figure 2g In the user interface 20g shown, the electronic device 100 displays the main interface 207 of the software update application. Figure 2b It can be understood that the main interface 207 of the software update application is the display interface of the software update application.

[0050] After the software update application detects a new version of the system software, it will display the following Figure 2h The user interface 20h shown. The new version interface 208 of the software update application can refer to the above Figure 2c The user can click on the "Download and Install" control in the new version interface 208 of the software update application to download the new version installation package.

[0051] In response to the user clicking the "Download and Install" control in the new version interface 208 of the software update application, the following is displayed: Figure 2i In the user interface 20i shown, the electronic device 100 redraws the new version interface of the software update application and displays the redrawn new version interface 209. The new version interface 209 includes "Downloading...", the version information of the new version, an "Update Log" display box, and a "Cancel" control.

[0052] It is understandable that if the download of the new version of the installation package fails due to network anomalies / file writing errors / integrity check failures, the electronic device will refresh the user interface and display a pop-up window with a "Download Failed" prompt, as shown in the following example: Figure 2j User interface 20j is shown.

[0053] like Figure 2j As shown, the user interface 20j includes a "download failed" prompt pop-up window 210 displayed on the new version interface displayed in full screen. Among them, the "download failed" prompt pop-up window 210 includes a prompt text message of "download failed, please try again later" and an "OK" control 2101.

[0054] It is understandable that at this time the user interface suddenly switches from column display to full-screen display, affecting the user's viewing experience.

[0055] Continue to refer Figure 2j In response to the user clicking the “OK” control 2101, the electronic device 100 displays the following Figure 2k The user interface shown in 20k. Compared to Figure 2b As shown in the user interface 20b and the user interface 20k, there is no text message such as "checking", and the "check for updates" control 211 is also in a clickable state.

[0056] Even if the user does not click the "Check for Updates" control 211, when a new version of the installation package is found, the electronic device 100 will start to display the following information: Figure 2h User interface 20h is shown.

[0057] Understandably, at this time the user interface will suddenly switch from full-screen display to column display, affecting the user's viewing experience.

[0058] It is understandable that the above Figures 2a to 2k The schematic diagram of the interface change shown is only an example of an abnormal interface jump. For example, in other embodiments, the user can also open the software update application through the system notification box and enter the new version interface of the software update application.

[0059] For example, the system notification box can refer to Figure 2l User interface 201 is shown. This user interface 201 includes application icons for multiple applications, such as a settings application, a clock application, and a browser application, as well as a system "Software Update" notification box 212. The "Software Update" notification box 212 includes a prompt message stating "xxxxx is available for your device," a "Later" control 2121, a "Details" control 2122, and a "Download and Install" control 2123. The user can click the "Download and Install" control 2123 to open the software update application and enter the new version interface of the software update application.

[0060] As mentioned above, the above Figures 2a to 2k The abnormal jump of the display interface shown is related to the activity with the same name in the same display interface of the same application.

[0061] The following is an introduction to the technical solutions related to Activity and interface display.

[0062] It can be understood that Activity is a component responsible for interacting with the user, used to display the interface and monitor the user's operation behavior on the interface. In the system, an Activity is usually a separate screen, which can display some controls, and can also listen to and process user events to respond. The screens mentioned here are not necessarily complete independent display screens. Taking "two screens" as an example, these two screens may be two independent display areas in a complete display screen. Of course, if the terminal has two or even more independent display screens, then "two screens" can also be two independent display screens. When the interface is displayed, one interface corresponds to one Activity. For example, Figure 1c The interface 14 of the software update application shown corresponds to Activity 1 .

[0063] In the column display mode, one display column corresponds to one interface, and one interface corresponds to one Activity. For example, Figure 1a The interface 11 of the setting application shown corresponds to Activity 2 , and the interface 12 of the software update application corresponds to Activity 1 .

[0064] That is to say, each application can include one or more Activities. In the system, multiple activities of the same application will be stored in the same task stack. In the split-column display mode, when different display columns are used to display the interfaces of different applications, the activities of different applications must also be in the same task stack.

[0065] For example, Figure 1a The interface 11 of the setting application corresponds to Activity2 and the interface 12 of the software update application corresponds to Activity1 in the task stack of the setting application (hereinafter referred to as setting TASK). For another example, Figure 1c The corresponding Activity 1 of the software update application interface 14 shown will also exist in the task stack of the software update application (hereinafter referred to as OUC TASK). That is, both the setup TASK and the OUC TASK contain the same Activity 1.

[0066] The following combines the above Figures 2a to 2k The following diagram shows the interface changes and introduces the corresponding Activity changes.

[0067] For example, Figures 3a to 3i Shows a Figures 2a to 2k The diagram shows the changes in the activity of the electronic device 100 during the interface change process.

[0068] like Figure 3a As shown, the electronic device 100 starts the software update application and displays the following Figure 2bWhen the user interface 20b is shown, since the software update application is opened, the interface of the software update application will be displayed, so an OUC TASK will be created, and Activity A for displaying the software update application main interface 20b will be created in OUCTASK, and Activity A in OUC TASK corresponds to the foreground display interface.

[0069] like Figure 3b As shown, the electronic device 100 displays Figure 2c In the new version interface 20c shown, since the new version check is monitored by Activity A corresponding to the software update application main interface 20b in OUC TASK, Activity B for displaying the current new version interface 20c will be created in OUC TASK. It can be understood that Activity A is not destroyed at this time. OUC TASK includes Activity A and Activity B, and Activity B in OUC TASK corresponds to the foreground display interface.

[0070] like Figure 3c As shown, the electronic device 100 displays Figure 2e When the user interface 20e of the settings application is shown, since the settings application is opened, the settings application interface will be displayed, so a settings TASK will be created, and Activity C for displaying the settings item list interface 205 will be created in the settings TASK. It can be understood that at this time, the software update application is running in the background, that is, the Activity in the OUCTASK has not been destroyed, the electronic device 100 includes Activity A and Activity B in the OUC TASK, and Activity C in the settings TASK, and Activity C in the settings TASK corresponds to the display interface in the foreground.

[0071] like Figure 3d As shown, the electronic device 100 displays Figure 2fThe user interface shown is, that is, the setting item list interface 205 of the setting application and the system and update interface 206 of the setting application are displayed. Since the user clicks on the system and update control in Activity C corresponding to the setting item list interface 205 in the setting TASK, the electronic device 100 creates Activity D for displaying the system and update interface 206 on Activity C in the setting TASK, and Activity C and Activity D in the setting TASK correspond to the display interface in the foreground. It can be understood that since the software update application is still running in the background at this time, that is, the activity in the OUC TASK has not been destroyed, the electronic device 100 includes Activity A and Activity B in the OUC TASK, as well as Activity C and Activity D in the setting TASK.

[0072] like Figure 3e As shown, the electronic device 100 displays reference Figure 2g In the main interface 207 of the software update application shown, since the user clicks on the "Software Update" control 2061, it is monitored by Activity D corresponding to the system and update interface 206 of the setting application in the setting TASK, and the setting application is in column display mode, the main interface 207 of the software update application needs to be displayed on the display interface of the setting application. Therefore, Activity A for displaying the main interface 207 of the software update application is created on top of Activity D in the setting TASK, and Activity C and Activity A in the setting TASK correspond to the display interface of the foreground. It can be understood that since the software update application is still running in the background at this time, that is, the activities in the OUC TASK have not been destroyed, the electronic device 100 includes Activities A and B in the OUC TASK, as well as Activities A, C, and D in the setting TASK. Moreover, since the software update application main interface 207 and the software update application main interface 20b correspond to the same interface of the software update application, the names of the Activity instances corresponding to the software update application main interface 207 and the software update application main interface 20b are the same, that is, Activity A in TASK and Activity A in OUC TASK are set to Activity instances with the same name.

[0073] like Figure 3f As shown, the electronic device 100 displays Figure 2hWhen the new version interface 208 is shown, since the new version check is monitored by Activity A corresponding to the main interface 207 of the software update application in the settings TASK, Activity B is created on top of Activity A in the settings TASK to display the current new version interface 208, and Activity C and Activity B in the settings TASK correspond to the display interface in the foreground. It can be understood that since the software update application is still running in the background at this time, that is, the activities in the OUC TASK have not been destroyed, the electronic device 100 includes Activity A and Activity B in the OUC TASK, as well as Activity A, Activity B, Activity C, and Activity D in the settings TASK. In addition, since the new version interface 208 and the new version interface 20c correspond to the same interface of the software update application, the names of the activity instances corresponding to the new version interface 208 and the new version interface 20c are the same, that is, Activity B in the settings TASK and Activity B in the OUC TASK are activity instances with the same name.

[0074] It can be understood that in response to the user clicking the "Download and Install" control in the new version interface 208 of the software update application, the electronic device 100 redraws the new version interface of the software update application and displays the redrawn new version interface 209. Since the redraw operation is monitored by Activity B corresponding to the new version interface 208 in the settings task, the redrawn new version interface 209 still corresponds to Activity B in the settings task.

[0075] If the download of the new version of the installation package fails due to network anomalies / file writing errors / integrity check failure, etc., the electronic device will refresh the user interface and display a pop-up window prompting "Download Failed", that is, it will start the Activity instance corresponding to the refresh event through the startActivity method. Since the startActivity method will query whether there is an Activity instance corresponding to the refresh event in the task stack of the software update application displayed in full screen, if it exists, it will directly start the Activity instance corresponding to the refresh event in the task stack of the software update application displayed in full screen. The current electronic device simultaneously has an instance of Activity B corresponding to the new version interface 20c of the software update application displayed in full screen, and an instance of Activity B corresponding to the new version interface 208 of the software update application displayed in columns. When the download of the new version of the installation package fails, the electronic device 100 detects that an instance of Activity B corresponding to the new version interface 208 already exists, that is, it detects an instance of Activity B corresponding to the new version interface of the software update application displayed in full screen. Even if the full-screen software update application is currently running in the background, and an instance of Activity B corresponding to the new version interface of the software update application exists in the task stack of the foreground settings application, the electronic device will still automatically launch the instance of Activity B corresponding to the new version interface of the full-screen software update application, refresh the new version interface 208 corresponding to the Activity instance, and display a pop-up window indicating "Download Failed." This causes the user interface to suddenly switch from split-column display to full-screen display, affecting the user's viewing experience.

[0076] like Figure 3g As shown, the electronic device 100 starts the instance of Activity B corresponding to the main interface of the software update application in OUC TASK, and displays the following Figure 2j The user interface 20j shown in FIG. 20 is shown in FIG. 20b , and Activity B in OUC TASK corresponds to the display interface in the foreground. It can be understood that since the settings application is running in the background at this time, that is, the Activity in the settings TASK is not destroyed, the electronic device 100 includes Activity A and Activity B in OUC TASK, as well as Activity A, Activity B, Activity C, and Activity D in the settings TASK.

[0077] In response to the user clicking the "OK" control 2101 in the user interface 20j, the operation triggers the software update application to search for packages again. Figure 3hAs shown, the electronic device 100 places the instance of Activity A corresponding to the main interface of the software update application in the OUC TASK on the top of the stack, and destroys other Activity instances in the OUC TASK (for example, Activity B), displays the full-screen main interface 20k of the software update application, and Activity A in the OUC TASK corresponds to the display interface in the foreground. It can be understood that since the settings application is still running in the background at this time, that is, the Activity in the settings TASK has not been destroyed, the electronic device 100 includes Activity A in the OUC TASK, as well as Activity A, Activity B, Activity C, and Activity D in the settings TASK.

[0078] Since the new version check listener of the instance of Activity A corresponding to the main interface of the software update application displayed in the column created later will overwrite the new version check listener of the instance of Activity A corresponding to the main interface of the software update application displayed in the full screen created earlier, the electronic device 100 will call back the instance of Activity A corresponding to the main interface of the software update application displayed in the column created later to perform a new version check (i.e., search for packages).

[0079] Therefore, although the user interface displayed by the electronic device 100 at this time is the full-screen main interface of the software update application, since the electronic device 100 calls back the instance of Activity A corresponding to the main interface of the software update application displayed in the columns to perform the new version check, the new version check is not implemented by the instance of Activity A corresponding to the full-screen main interface of the software update application, but by the instance of Activity A corresponding to the main interface of the software update application displayed in the columns. Figure 2b As shown in the user interface 20b and the user interface 20k, there is no text message such as "checking", and the "check for updates" control 211 is also in a clickable state.

[0080] And, as Figure 3i As shown, since the new version check is implemented by the instance of Activity A corresponding to the main interface of the software update application displayed in the column, when the new version installation package is searched, the electronic device 100 will start the instance of Activity B corresponding to the new version interface of the software update application displayed in the column, and display the following Figure 2h The user interface 20h shown in the figure is displayed, and Activity C and Activity B in the task are set to correspond to the foreground display interface. As a result, the user interface will suddenly switch from full-screen display to column display, affecting the user's viewing experience.

[0081] It should be understood that the above description only uses the Settings app and the Update app as examples to introduce the abnormal jump scenarios involved in the embodiments of the present application. Among them, Activity A can be SettingMainActivity corresponding to the main interface of the Settings app, Activity B can be SystemUpdateActivity corresponding to the system and update interfaces of the Settings app, Activity C can be MainEntranceActivity corresponding to the main interface of the Software Update app, and Activity D can be FirmwareNewVersionActivity corresponding to the new version interface of the Software Update app. In other embodiments, the Settings app and the Software Update app can also be other applications that support the column display mode.

[0082] In view of this, an embodiment of the present application provides a display method. When an electronic device generates a display interface, it creates an Activity instance corresponding to the display interface and determines the state attributes of the Activity instance (foreground state attributes and / or column state attributes). That is, it determines whether the display interface belongs to the foreground interface and / or the column interface, and records the state attribute values ​​representing the state attributes of the Activity instance. At the same time, when the state attributes of the Activity instance change, the corresponding state attribute values ​​are updated in real time.

[0083] When an interface refresh event is detected, the target Activity instance corresponding to the interface refresh event is determined. If a target Activity instance has already been created, the corresponding refresh strategy is determined based on the state attributes of the target Activity instance. For example, if it is determined that a target Activity instance has already been created and its foreground state attribute is the foreground attribute, the target Activity instance displayed in the foreground is directly notified to perform an interface refresh. Alternatively, if it is determined that a target Activity instance has already been created and its foreground state attribute is the background attribute, the target Activity instance running in the background is started to perform an interface refresh.

[0084] For example, for Figures 2a to 2k In the scenario shown, the electronic device will also create an Activity instance set to manage the Activity instances created in the electronic device, for example, the Activity instance in the setting TASK and the Activity instance in OCUTASK are stored in the Activity instance set.

[0085] Electronic devices display Figure 2iWhen the new version interface 209 in the user interface 20i shown is displayed and the new version of the installation package is downloaded, if the download of the new version of the installation package fails due to network abnormality / file writing error / integrity check failure, etc., the electronic device will refresh the new version interface and display a pop-up window prompting "Download failed".

[0086] like Figure 3f As shown, the current electronic device simultaneously has an instance of Activity B corresponding to the new version interface 20c of the software update application displayed in full screen, and an instance of Activity B corresponding to the new version interface 208 of the software update application displayed in columns. It can be understood that the target activity is the instance of Activity B corresponding to the new version interface 20c or the new version interface 208. In addition, the instance of Activity B corresponding to the new version interface 208 of the software update application displayed in columns is in the task stack of the settings application displayed in the foreground, that is, the foreground state attribute of the instance of Activity B corresponding to the new version interface 208 of the software update application displayed in columns is the foreground attribute. The electronic device then directly notifies the instance of Activity B corresponding to the new version interface 208 of the software update application displayed in columns to refresh the interface.

[0087] For example, refer to Figure 4a As can be understood, compared to the user interface 40a shown in FIG. Figure 2j In the user interface 20j shown, the "Download Failed" prompt pop-up window 401 in the user interface 40a is displayed on the user interface displayed in columns.

[0088] Furthermore, if Figure 4a As shown, in response to the user clicking the "OK" control 4011, the new version check is triggered, and the electronic device 100 calls back the instance of Activity A corresponding to the main interface of the software update application displayed in the column to perform the new version check, that is, the new version check is implemented by the instance of Activity A corresponding to the main interface of the software update application displayed in the column. Therefore, the electronic device 100 refreshes the main interface of the software update application displayed in the column and displays the following Figure 2g User interface 20g is shown.

[0089] Moreover, since the new version check is implemented by the instance of Activity A corresponding to the main interface of the software update application displayed in the column, when the new version installation package is searched, the electronic device 100 will start the instance of Activity B corresponding to the new version interface of the software update application displayed in the column, and display the following: Figure 2h User interface 20h is shown.

[0090] It can be understood that the display method provided in the embodiment of the present application, when a refresh event is detected, if it is detected that a target Activity instance corresponding to the refresh event already exists and is displayed in the foreground, the target Activity instance displayed in the foreground is directly notified to refresh, and there will be no abnormal jump of the user interface, thereby improving the user experience.

[0091] For example, Figure 4b According to the embodiment of the present application, a flow chart of a display method is shown. It can be understood that Figure 4b Each step of the process shown is performed by the electronic device 100. Figure 4b The execution entities of each step will not be described repeatedly in the steps of the process shown. Figure 4b As shown, the process includes but is not limited to the following steps:

[0092] S401: A first refresh event for a display interface of a first application is detected, and a first display interface and a second display interface of the first application are currently running are detected.

[0093] It can be understood that the first refresh event may be an interface refresh event acquired by the system side of the electronic device 100, such as the aforementioned failure to download the new version.

[0094] In some embodiments, the first application may be a software update application, and the first display interface and the second display interface are the same display interface of the first application, such as a new version interface.

[0095] S402: Acquire status attributes of the first display interface and the second display interface.

[0096] It can be understood that the state attributes of the first display interface and the second display interface may include a foreground state attribute, and the foreground state attribute value is used to indicate whether the corresponding display interface is a foreground interface or a background interface.

[0097] S403: Based on the state attributes of the first display interface and the second display interface, determine that the first display interface is displayed in the background and the second display interface is displayed in the foreground.

[0098] It is understood that the first display interface can be the above Figure 2c The new version interface 20c shown, the second display interface can be the above Figure 2g The new version interface 208 is shown.

[0099] For example, the electronic device detects the operation of displaying the first display interface, displays the first display interface, creates and stores the Activity instance and state attributes corresponding to the first display interface. Figure 2cA new version interface 20c of the software update application is shown.

[0100] After detecting the operation of displaying the second display interface, the second display interface is displayed, and the Activity instance and state attributes corresponding to the second display interface are created and stored. The first display interface is run in the background, and the foreground state attributes of the Activity instance corresponding to the first display interface are updated. For example, when the user clicks the "Software Update" control 2061, the software update application is started, the display interface of the software update application is displayed, and the activity instance and state attributes of the activity instance corresponding to the first display interface are run in the background. Figure 2c A new version interface 20c of the software update application is shown.

[0101] S404: Determine the second display interface as the interface to be refreshed, and refresh the second display interface in response to the first refresh event.

[0102] After the electronic device 100 determines that the first display interface is displayed in the background and the second display interface is displayed in the foreground, that is, the foreground state attribute of the first display interface is the background attribute and the foreground state attribute of the second display interface is the foreground attribute, the second display interface is set as the interface to be refreshed. Furthermore, a refresh operation corresponding to the first refresh event is performed on the second display interface.

[0103] For example, the electronic device 100 directly notifies the Activity instance corresponding to the second display interface to refresh the interface. Specifically, it includes: sending a refresh message to the Activity instance corresponding to the second display interface through the refresh callback interface. The Activity instance corresponding to the second display interface refreshes the second display interface based on the refresh message.

[0104] It can be understood that the state attributes of the first display interface and the second display interface may further include column state attributes (eg, column display or full-screen display).

[0105] If the column status attribute of the first display interface is column display and the column status attribute of the second display interface is full screen display, the electronic device 100 can start the Activity instance corresponding to the second display interface through the startActivity method. The Activity instance corresponding to the second display interface refreshes the second display interface in response to the start operation.

[0106] It can be understood that the display method provided in the embodiment of the present application, when a refresh event is detected, if it is detected that a second display interface corresponding to the refresh event is already displayed in the foreground, the second display interface displayed in the foreground will be refreshed directly, and there will be no abnormal jump of the user interface, thereby improving the user experience.

[0107] Specifically, the display method provided in the embodiment of the present application includes:

[0108] The electronic device manages the Activity instances of each application, for example, by storing them in an Activity instance collection and recording the state attributes (foreground state attributes and / or column state attributes) of each Activity instance. Furthermore, a refresh callback interface is added to the Activity instance collection to implement the onHandlerMessage callback method for processing refresh messages upon receiving an interface refresh notification, allowing the target Activity to process the interface refresh.

[0109] When an interface refresh event is detected, the first step is to determine whether the target Activity instance corresponding to the interface refresh event exists in the Activity instance collection. If the target Activity instance exists in the Activity instance collection, the next step is to determine whether the target Activity instance exists with the foreground state attribute set to foreground state.

[0110] If there is a target Activity instance whose foreground state attribute is the foreground state, the target Activity instance displayed in the foreground will be notified through the refresh callback interface to refresh the interface. In addition, it can be further determined whether the column state attribute of the target Activity instance displayed in the foreground is the column display attribute. If the column state attribute is a non-column display attribute, for example, a full-screen display attribute, the target Activity instance displayed in the foreground can be started through the startActivity method. If the column state attribute is a column display attribute, the target Activity instance displayed in the foreground will be notified through the refresh callback interface to refresh the interface.

[0111] If there is no target Activity instance whose foreground state attribute is foreground state, that is, the target Activity instance only exists in the background, then the target Activity instance is started through the startActivity method, and the target Activity instance running in the background is returned to the foreground, refreshed and displayed.

[0112] If the target Activity instance does not exist in the Activity instance collection, the target Activity instance will be created through the startActivity method and added to the Activity instance collection.

[0113] It can be understood that the Activity instance set in the embodiment of the present application can be a global management of the Activity instances of all applications in the electronic device, or it can be an independent management of the Activity instances of each application in the electronic device. This application does not impose any restrictions on this.

[0114] The following describes in detail how the electronic device 100 defines an Activity instance set, taking the example of independently managing the Activity instances of various applications in the electronic device using the Activity instance set.

[0115] Specifically, the electronic device 100 can use a HashMap to store created Activity instances in the form of key-value pairs, where the key is the name of the Activity instance and the value is a list of Activity instance objects. In other words, the list of Activity instance objects can include multiple Activity instances corresponding to one Activity name.

[0116] For example, the Activity instance manager class can be implemented by the following code:

[0117] private static final HashMap <String,List <activityrecord>>ACTIVITY_MAP=new HashMap<>();

[0118] Among them, ACTIVITY_MAP represents the Activity instance collection; String represents the name of the Activity instance in string format; List <activityrecord>The object list representing the Activity instance is in list form, which stores the records of the Activity instance corresponding to the Activity instance name, that is, the created Activity instance.

[0119] In some embodiments, when an Activity instance needs to be created, the electronic device 100 queries the Activity instance set to see if the target Activity instance to be created exists. If so, the target Activity instance to be created is not added to the Activity instance set; if not, the target Activity instance to be created is added to the Activity instance set.

[0120] Specifically, the method of creating an Activity instance includes:

[0121] The electronic device 100 queries the existing Activity instance list from the Activity instance collection using the input key (the name of the target Activity instance to be created).

[0122] If the returned list of existing Activity instances is not empty, it means that an Activity instance has already been created. Then, the program checks whether the target Activity instance to be added to the Activity instance collection (the target Activity instance to be created) exists in the returned list of existing Activity instances. If it does, the program does not add it again. Otherwise, the program adds the target Activity instance to the list of Activity instances.

[0123] If the returned list of existing Activity instances is empty, it means that there is no created Activity instance. In this case, a new Activity instance list is created and the target Activity instance to be created is added to the Activity instance collection.

[0124] For example, creating an Activity instance can be achieved by calling the add instance method of the Activity manager class in the onCreate method of the target Activity instance using the following code:

[0125]

[0126] Wherein, onCreate represents the onCreate method, and ActivityTaskManager.putActivityToMap represents the add instance method of the Activity manager class. In some embodiments, when an Activity instance is destroyed, the electronic device 100 clears the destroyed Activity instance in the Activity instance set.

[0127] Specifically, the methods for clearing Activity instances include:

[0128] The electronic device 100 queries the existing Activity instance list from the Activity instance collection using the passed-in key (the name of the target Activity instance to be destroyed); and then removes the passed-in target Activity instance (the target Activity instance to be destroyed) from the Activity instance list.

[0129] For example, destroying an Activity instance can be achieved by calling the delete instance method of the Activity manager class in the onDestroy method of the target Activity instance using the following code:

[0130]

[0131] Among them, onDestroy represents the onDestroy method, and ActivityTaskManager.removeActivityFromMap represents the instance deletion method of the Activity manager class.

[0132] In some embodiments, the electronic device 100 also determines and stores the state attributes (foreground state attributes and / or column state attributes) of each Activity instance in the Activity instance set.

[0133] Specifically, in some embodiments, when an Activity instance returns from the foreground to the background, the electronic device 100 modifies the foreground state attribute of the Activity instance from a foreground attribute to a background attribute, for example, setting the foreground attribute value from yes (true) to no (false).

[0134] For example, when an Activity instance returns from the foreground to the background, the following code can be used to call the update foreground state method of the Activity manager class in the onPause method of the target Activity instance to update the foreground state to no:

[0135]

[0136] Among them, onPause represents the onPause method, and ActivityTaskManager.updateActivityForegroundState represents the method of updating the foreground state of the Activity manager class.

[0137] Specifically, in other embodiments, when an Activity instance returns to the foreground from the background, the electronic device 100 modifies the foreground state attribute of the Activity instance from the background attribute to the foreground attribute, for example, setting the foreground attribute value from no (false) to yes (true).

[0138] For example, when the Activity instance returns to the foreground from the background, the following code can be used to call the update foreground state method of the Activity manager class in the onResume method of the target Activity instance to update the foreground state to yes:

[0139]

[0140] Wherein, onResume represents the onResume method. In some embodiments, when the Activity instance returns to the foreground from the background, the electronic device 100 will also refresh the monitoring corresponding to the Activity instance (for example, checking for a new version of the monitoring, etc.).

[0141] In some embodiments, the electronic device 100 will also determine the column status attribute of each Activity instance when creating each Activity instance. For example, if the column status attribute of the Activity instance is a column display attribute, the flag bit (Flag) corresponding to the column status attribute is set to 0; if the column status attribute of the Activity instance is a non-column display attribute (such as a full-screen display attribute), the flag bit (Flag) corresponding to the column status attribute is set to a non-zero value (such as 0x00000001, 0x00000004, etc.). It can be understood that this application does not limit the specific value of the flag bit.

[0142] It can be understood that the foreground state attribute is used to indicate whether the display is in the foreground, and the column state attribute is used to indicate whether the display is in the columns. For example, the foreground state attribute may include: foreground attribute (e.g., foreground display) and background attribute (e.g., background display). The column state attribute may include: column display attribute (e.g., column display) and non-column display attribute (e.g., full screen display).

[0143] In some other embodiments, the state attributes may further include a floating state attribute for indicating whether the display is floating, a full-screen state attribute for indicating whether the display is full-screen, etc., which is not limited in this application.

[0144] In order to better understand the technical solutions of the embodiments of the present application, some technical solutions of the present application are introduced in detail below, taking the electronic device 100 as a foldable mobile phone as an example.

[0145] Figure 5 According to an embodiment of the present application, a flow chart of another display method is shown. It can be understood that Figure 5 Each step of the process shown is performed by the electronic device 100. Figure 5 The execution entities of each step will not be described repeatedly in the steps of the process shown. Figure 5 As shown, the process includes but is not limited to the following steps:

[0146] S501: Detecting an interface refresh event and determining a target Activity corresponding to the interface refresh event.

[0147] The electronic device 100 detects an interface refresh event, such as the aforementioned Figure 4a The download failure pop-up window shown above determines the target Activity corresponding to the interface refresh event. Figures 2a to 2k Take the refresh event shown in as an example, the target activity is Activity B.

[0148] S502: Determine whether there is a created target Activity.

[0149] It can be understood that the electronic device 100 defines an Activity instance manager class, which defines an Activity instance set for storing Activity instances created by the electronic device 100. The electronic device 100 determines whether the target Activity exists in the Activity instance set. The electronic device 100 also obtains foreground and background interface update events and updates the foreground state attributes of each instance in real time. For example, the update foreground state method of the Activity manager class is called in the onPause method and onResume method of the target Activity instance. In addition, the electronic device 100 will also determine the column state attributes of each Activity instance when creating each Activity instance.

[0150] In some embodiments, if the judgment result is yes, it means that there are one or more target Activities that have been created. There is no need to create a target Activity. Further judgment can be performed to determine whether there is a target Activity with a foreground state attribute as the foreground attribute among the one or more target Activities that have been created. Then, step S504 is executed to determine whether there is a target Activity with a foreground state attribute as the foreground attribute.

[0151] In some embodiments, if the judgment result is no, it means that there is no created target Activity and the target Activity needs to be created, then step S503 is executed to create the target Activity and notify the target Activity to draw and display the target interface.

[0152] It can be understood that the electronic device 100 can determine whether the target Activity exists in the Activity instance set through the above method of creating an Activity instance.

[0153] Specifically, the electronic device 100 queries the Activity instance collection for a list of existing Activity instances using the name of the target Activity instance. If the returned list of existing Activity instances is not empty, it indicates that one or more target Activity instances have been created; if the returned list of existing Activity instances is empty, it indicates that no target Activity instance has been created.

[0154] S503: Create a target Activity, draw and display the target interface.

[0155] After the electronic device determines that the target Activity does not exist in the Activity instance set, it directly calls the startActivity method to start the target Activity instance and adds the target Activity instance to the Activity instance set.

[0156] Specifically, the method of adding the target Activity instance to the Activity instance set can refer to the above description of the method of creating an Activity instance in the Activity instance manager class, which is not repeated here.

[0157] For example, taking the interface refresh event as the download failure pop-up window and the target Activity as the FirmwareNewVersionActivity corresponding to the new version interface of the software update application as an example, the created target Activity does not exist in the current electronic device, and the current display interface of the electronic device 100 can be as follows: Figure 2d The desktop 20d shown can also be other applications besides the software update application. After the electronic device 100 calls the startActivity method to start the target Activity instance, the display interface of the electronic device 100 can be Figure 2d The desktop 20d shown jumps to Figure 2j User interface 20j is shown.

[0158] S504: Determine whether there is a target Activity whose foreground state attribute is the foreground attribute.

[0159] After the electronic device determines that the target Activity exists in the Activity instance set, it continues to determine whether there is a target Activity with a foreground state attribute as the foreground attribute in the Activity instance list corresponding to the target Activity name.

[0160] In some embodiments, if the judgment result is yes, it indicates that there is a target Activity with a foreground state attribute of the foreground attribute, and the next judgment can be performed, that is, step S505 is executed to determine whether it is a target Activity with a column display attribute.

[0161] In other embodiments, if the judgment result is no, indicating that there is no target Activity whose foreground state attribute is the foreground attribute, step S507 is executed to start the target Activity, draw and display the target interface.

[0162] For example, the electronic device 100 can determine whether there is a target Activity instance with a foreground state attribute set to the foreground attribute (e.g., a foreground attribute value of true) in the Activity instance list corresponding to the target Activity name. If so, the electronic device 100 returns the target Activity instance with the foreground state attribute set to the foreground attribute; if not, the electronic device 100 returns a null value.

[0163] It is understood that in other embodiments, if the judgment result is yes, indicating that there is a target activity with a foreground state attribute set to the foreground attribute, step S505 may be skipped and step S506 may be directly executed to notify the target activity to draw and display the target interface. In other words, regardless of whether the target activity instance with a foreground state attribute set to the foreground attribute is the target activity of the column interface, the target activity instance with a foreground state attribute set to the foreground attribute may be directly notified to draw and display the target interface.

[0164] S505: Determine whether it is the target Activity of the column display attribute.

[0165] After the electronic device determines that there is a target Activity with a foreground state attribute as the foreground attribute in the Activity instance set, it continues to determine whether the column state attribute of the target Activity with the foreground state attribute as the foreground attribute is the column display attribute.

[0166] In some embodiments, if the judgment result is yes, indicating that the target Activity with the foreground state attribute being the foreground attribute is the target Activity with the column display attribute, step S506 is executed to notify the target Activity to draw and display the target interface.

[0167] In other embodiments, if the judgment result is no, indicating that the target activity with the foreground state attribute is a target activity with a non-column display attribute, step S507 is executed to start the target activity and draw and display the target interface.

[0168] Exemplarily, the electronic device 100 may determine whether the column state attribute of the target activity whose foreground state attribute is the foreground attribute is the column display attribute, for example, by determining whether the flag bit corresponding to the column state attribute is 0. If the flag bit corresponding to the column state attribute is 0, it is determined that the column state attribute of the target activity whose foreground state attribute is the foreground attribute is the column display attribute; if the flag bit corresponding to the column state attribute is a non-zero value, it is determined that the column state attribute of the target activity whose foreground state attribute is the foreground attribute is the non-column display attribute.

[0169] S506: Notify the target Activity to draw and display the target interface.

[0170] The electronic device 100 determines that there is a target Activity instance in the Activity instance set whose foreground state attribute is the foreground attribute and whose column state attribute is the column display attribute, and notifies the target Activity to draw and display the target interface.

[0171] In some embodiments, the electronic device 100 determines that there is a target Activity instance whose foreground state attribute is the foreground attribute in the Activity instance set, and notifies the target Activity to draw and display the target interface.

[0172] For example, taking the interface refresh event as the download failure pop-up window and the target Activity as the FirmwareNewVersionActivity corresponding to the new version interface of the software update application as an example, there is a target Activity instance in the current electronic device whose foreground state attribute is the foreground attribute and the column state attribute is the column display attribute. The current display interface of the electronic device 100 can be as follows: Figure 2i After the electronic device 100 notifies the target Activity to draw and display the target interface, the display interface of the electronic device 100 can be Figure 2i The user interface 20i shown jumps to Figure 4a User interface 40a is shown.

[0173] Or for example, still taking the interface refresh event as the download failure pop-up window and the target Activity as the FirmwareNewVersionActivity corresponding to the new version interface of the software update application as an example, there is a target Activity instance in the current electronic device whose foreground state attribute is the foreground attribute and the column state attribute is the full screen display attribute. The current display interface of the electronic device 100 can be as follows Figure 6 The user interface 60a shown in FIG. The user interface 60a includes "Downloading...", the version information of the new version, the "Update Log" display box and the "Cancel" control. After the electronic device 100 notifies the target Activity to draw and display the target interface, the display interface of the electronic device 100 can be changed. Figure 6 The user interface 60a shown jumps to Figure 2j User interface 20j is shown.

[0174] Specifically, the method for notifying the target activity to draw and display the target interface includes calling the notifyRefresh method to notify the target activity of a refresh message. The target activity implements the refresh message callback method onHandlerMessage through the refresh callback interface RefreshListener defined in the Activity manager class, so that the target activity can handle the interface refresh, that is, draw and display the target interface.

[0175] For example, the following code can be used to call the notifyRefresh method to notify the target Activity of the refresh message:

[0176] public static void notifyRefresh(String mapKey,Activity activity,Message message){

[0177] }

[0178] Among them, mapKey is the name of the target Activity, activity is the target Activity, and message is the message to be refreshed.

[0179] For example, the target Activity can implement the onHandlerMessage callback method through the refresh callback interface RefreshListener through the following code:

[0180]

[0181] Among them, ActivityTaskManager.RefreshListener is the refresh callback interface defined in the Activity manager class, and onHandlerMessage is the callback method for processing refresh messages.

[0182] S507: Start the target Activity, draw and display the target interface.

[0183] The electronic device 100 determines that there is no target Activity instance with the foreground state attribute as the foreground attribute in the Activity instance set, that is, the foreground state attribute of one or more target Activities in the Activity instance set is the background attribute, and then starts the target Activity through the startActivity method.

[0184] For example, taking the interface refresh event as the download failure pop-up window and the target Activity as the FirmwareNewVersionActivity corresponding to the new version interface of the software update application as an example, the foreground state attribute of the target Activity in the current electronic device is the background attribute, and the current display interface of the electronic device 100 can be as follows: Figure 2d The desktop 20d shown can also be other applications besides the software update application. After the electronic device 100 calls the startActivity method to start the target Activity instance, the display interface of the electronic device 100 can be Figure 2d The desktop 20d shown jumps to Figure 2j User interface 20j is shown.

[0185] In some embodiments, the electronic device 100 determines that there is a target Activity instance in the Activity instance set whose foreground state attribute is the foreground attribute, and the column state attribute of the target Activity instance with the foreground state attribute is the foreground attribute is a non-column display attribute (for example, a full-screen state attribute), then starts the target Activity through the startActivity method.

[0186] For example, taking the interface refresh event as the download failure pop-up window and the target Activity as the FirmwareNewVersionActivity corresponding to the new version interface of the software update application as an example, there is a target Activity instance in the current electronic device with the foreground state attribute as the foreground attribute and the column state attribute as the full screen display attribute. The current display interface of the electronic device 100 can be as follows: Figure 6 The user interface 60a shown in FIG. The user interface 60a includes "Downloading...", the version information of the new version, the "Update Log" display box and the "Cancel" control. After the electronic device 100 notifies the target Activity to draw and display the target interface, the display interface of the electronic device 100 can be changed. Figure 6 The user interface 60a shown jumps to Figure 2j It is understood that in other embodiments, according to actual needs, the above Figure 5 The steps shown can be combined, deleted or replaced with other steps that are conducive to achieving the purpose of this application. For example, the above-mentioned step S505 can be deleted. This application does not limit this.

[0187] In summary, the display method provided by the embodiment of the present application, when generating a display interface, the electronic device creates an Activity instance corresponding to the display interface, determines the state attributes of the Activity instance, and records the state attribute values ​​representing the state attributes of the Activity instance. At the same time, when the state attributes of the Activity instance change, the corresponding state attribute values ​​are updated in real time. When an interface refresh event is detected, the target Activity instance corresponding to the interface refresh event is determined. If there is a target Activity instance that has been created, the corresponding refresh strategy is determined based on the state attributes of the target Activity instance. For example, if it is determined that there is a target Activity instance that has been created and its foreground state attribute is a foreground attribute, the target Activity instance displayed on the foreground is directly notified to refresh the interface. Abnormal jumps between the foreground display interface and the background running interface are avoided, thereby improving the user experience.

[0188] In order to better understand the technical solutions of the embodiments of the present application, the structure of the equipment involved in the present application is introduced below with reference to the accompanying drawings.

[0189] For example, Figure 7 A schematic structural diagram of an electronic device 100 is shown according to an embodiment of the present application.

[0190] like Figure 7 As shown, the electronic device 100 may include a processor 110, a memory 120, an interface module 130, a power module 140, a wireless communication module 150, a mobile communication module 160, an audio module 170, a sensor module 180, a button 190, a camera 191, a display screen 192, etc.

[0191] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0192] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. The processor 110 can be used to execute the display method provided in the embodiment of the present application.

[0193] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0194] The interface module 130 may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0195] The power module 140 is connected to the processor 110 and provides power to the processor 110 , the memory 120 , the camera 191 , the display screen 192 , and the mobile communication module 160 .

[0196] The wireless communication function of the electronic device 100 can be implemented through the wireless communication module 150, the mobile communication module 160, the antenna, the modem processor and the baseband processor.

[0197] The wireless communication module 150 can provide wireless communication solutions for application on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

[0198] In some embodiments, the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TDSCDMA), LTE, NR, BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc.

[0199] The mobile communication module 160 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied on the electronic device 100.

[0200] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals.

[0201] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0202] The electronic device 100 implements the display function through a GPU, a display screen 192 , and an application processor.

[0203] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. In some embodiments, the electronic device 100 displays the user interface of each application through the display screen 194.

[0204] The electronic device 100 can implement a shooting function through an ISP, a camera 191, a video codec, a GPU, a display screen 192, and an application processor.

[0205] The camera 191 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 191, where N is a positive integer greater than 1.

[0206] The memory 120 can be used to store computer executable program code, which includes instructions. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the memory 120, and / or instructions stored in a memory provided in the processor. In some implementation examples, the processor 110 executes the display method provided in the embodiment of the present application by running instructions stored in the memory 120.

[0207] The buttons 190 include a power button, a volume button, etc. The buttons 190 can be mechanical buttons or touch buttons.

[0208] In some embodiments, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, code set or instruction set is stored. The at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the display method provided by the above-mentioned method embodiments.

[0209] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplarily described.

[0210] Figure 8 According to an embodiment of the present application, a software structure block diagram of an electronic device 100 is shown.

[0211] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0212] The application layer can include a series of application packages.

[0213] like Figure 8 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0214] In addition, the application package may also include: home screen (ie, desktop), negative one screen, control center, notification center and other applications.

[0215] Among them, the negative one screen, also known as the "-1 screen", refers to the user interface of the leftmost split screen when you swipe the screen to the right on the main screen of the electronic device. For example, the negative one screen can be used to place some quick service functions and notification messages, such as global search, quick entry to a page of an application (such as a payment code), instant messages and reminders (express delivery information, expenditure information, commuting conditions, taxi travel information, schedule information, etc.), and follow-up dynamics (football stands, basketball stands, stock information, etc.). In some embodiments, users can search for the application name through global search and open the application, or open the corresponding application through the application's quick entry.

[0216] The control center is the upward sliding message notification bar of the electronic device, that is, the user interface displayed by the electronic device when the user starts to slide upward from the bottom of the electronic device.

[0217] The notification center is a drop-down message notification bar of an electronic device, that is, a user interface displayed by the electronic device when the user starts to operate downward at the top of the electronic device. In some embodiments, the user can open the corresponding application by clicking the message notification in the notification center.

[0218] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0219] like Figure 8 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, an activity manager, a notification manager, and the like.

[0220] The activity manager is used to interact with all running activities in the software system, manage and maintain all running activity-related information in the software system (such as tasks, memory, services, processes, apps, etc.); and provides corresponding interfaces for obtaining activity-related information.

[0221] Among them, Activity is a display component of an Android APP. Activity provides a window for interaction with users and is used to display the content of the APP. An Activity is usually a separate window, which can fill the display area of ​​the electronic device's display screen, or it can be smaller than the display area of ​​the electronic device and float above other windows. An APP is usually composed of multiple Activities that are loosely connected to each other. Usually, an APP can designate a certain Activity as the main Activity, which refers to the Activity presented to the user when the user first starts the APP. Correspondingly, the window presented by the main Activity is the main page in the APP. For example, the main page of a software update application is the page for checking for new versions.

[0222] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0223] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0224] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0225] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0226] The resource manager provides various resources for applications, such as localized strings, icons, images, user interface layout files (Layout XML), video files, fonts, colors, and identity documents (IDs) for user interface modules (UI components). Furthermore, the resource manager is used to centrally manage these resources.

[0227] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0228] The activity task manager is used to provide a collection of activity instances and a strategy for refreshing the display interface. For example, if a refresh event is detected with a target activity whose foreground state attribute is set to the foreground attribute, the target activity with the foreground state attribute is notified to refresh the display interface.

[0229] It can be understood that the Activity Task Manager can be a customized service for the software system, running in the system server. Its main function is to encapsulate a series of policy interfaces by combining multiple data modules within the service. It then embeds a stub process into the process of launching, managing, and displaying Activities in the native application framework layer to execute the policy of refreshing the display interface. The stub process refers to the code used to replace associated code or unimplemented code, that is, to write or generate stub code. One purpose of the stub process is to set the behavior of the policy-related code for refreshing the display interface during testing to meet testing requirements.

[0230] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.

[0231] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0232] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0233] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0234] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0235] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0236] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0237] A 2D graphics engine is a drawing engine for 2D drawings.

[0238] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0239] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0240] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0241] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0242] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to floppy disks, optical disks, optical discs, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Accordingly, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

[0243] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0244] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.

[0245] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further limitations, an element defined by the phrase "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0246] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.< / activityrecord> < / activityrecord>

Claims

1. A display method, applied to an electronic device, characterized in that: The method comprises: Detecting a first refresh event for a display interface of a first application, and detecting a first display interface and a second display interface on which the first application is currently running; Obtaining state attributes of the first display interface and the second display interface; Based on the state attributes of the first display interface and the second display interface, determining that the first display interface is displayed in the background and the second display interface is displayed in the foreground; The second display interface is determined as the interface to be refreshed, and Corresponding to the first refresh event, the second display interface is refreshed.

2. The method according to claim 1, characterized in that The state attributes include at least one of the following: Whether to display in the foreground, whether to display in columns, whether to display in floating mode, or whether to display in full screen mode.

3. The method according to claim 2, characterized in that The state attribute of the first display interface includes column display, and the state attribute of the second display interface includes full-screen display; or The state attribute of the first display interface includes full-screen display, and the state attribute of the second display interface includes column display.

4. The method according to claim 1, wherein Also includes: Detecting a first operation of displaying the first display interface, and displaying the first display interface; A second operation of displaying the second display interface is detected, the second display interface is displayed, and the first display interface is run in the background.

5. The method according to claim 3, characterized in that Also includes: Detecting a first operation of displaying the first display interface, generating and storing a first display component instance and first state attribute information of the first display interface, wherein the first state attribute information includes foreground display information; A second operation of displaying the second display interface is detected, and a second display component instance and second state attribute information of the second display interface are generated, wherein the second state attribute information includes foreground display information, and the first display component instance and the second display component instance are the same.

6. The method according to claim 5, characterized in that Also includes: Corresponding to detecting the second operation of displaying the second display interface and running the first display interface in the background, the first state attribute information of the first display interface is updated to third state attribute information, and the third state attribute information includes background display information.

7. The method according to claim 6, characterized in that The detecting of the first display interface and the second display interface on which the first application is currently running includes: The same first display component instance and second display component instance are detected, and it is determined that the first display interface and the second display interface of the first application are currently running.

8. The method according to claim 6, characterized in that The determining, based on the state attributes of the first display interface and the second display interface, that the first display interface is displayed in the background and the second display interface is displayed in the foreground includes: Determining, based on the third state attribute information of the first display interface, that the first display interface is displayed in the background; Based on the second state attribute information of the second display interface, it is determined that the second display interface is displayed in the foreground.

9. The method according to claim 8, characterized in that Refreshing the second display interface in response to the first refresh event includes: Sending a refresh message to the second display component through a refresh callback interface; The second display component instance refreshes the second display interface based on the refresh message.

10. The method according to claim 9, characterized in that The state attribute of the first display interface includes column display, and the state attribute of the second display interface includes full-screen display. The refreshing of the second display interface in response to the first refresh event further includes: Start the second display component instance corresponding to the second display interface by using the method of starting the display component; The second display component instance refreshes the second display interface in response to the start operation.

11. A readable medium, characterized in that The readable medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to any one of claims 1 to 10.

12. An electronic device, characterized in that: include: a memory for storing instructions to be executed by one or more processors of the electronic device, and The processor is one of the processors of an electronic device, and is configured to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Page management method and device, electronic equipment, medium and product

    CN112558937A

  • Updating method and device for user interface of application program

    CN114579164A