Display method, readable medium and electronic equipment

By detecting the interface refresh event and deciding the refresh strategy based on the status attributes, the abnormal jump problem caused by interface refresh in electronic devices is solved, and the user experience is improved.

CN119276970AActive Publication Date: 2025-01-07HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In electronic devices, when the interface of the same application is running at the foreground and background at the same time, the refresh event may cause the user interface to jump abnormally, affecting the user experience.

Method used

By detecting the interface refresh event, obtaining and determining the interface status attributes, determining whether the interface is displayed in the foreground or background, and determining whether to refresh the interface based on the status attributes, ensuring that the refresh event refreshes the interface displayed in the foreground to avoid the interface jump.

Benefits of technology

It effectively avoids abnormal interface jumps, improves user experience, and ensures the stability and consistency of the interface refresh process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276970A_ABST
    Figure CN119276970A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electronic equipment, and discloses a display method, a readable medium and electronic equipment. The display method comprises the steps of detecting a refresh event for a display interface of a first application, detecting a foreground display interface and a background display interface in which the first application runs currently, determining the foreground display interface as a to-be-refreshed interface, and refreshing the foreground display interface. Through the display of the application, the interface refreshing abnormal jump when the foreground display interface and the background display interface of the first application run 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, applications (APPs, hereinafter referred to as applications) in some electronic devices (e.g., tablet computers, foldable phones, etc.) can support a column display mode. In the column display 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 mobile 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 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 setting application interface 11 and the software update application interface 12 displayed in separate columns will return to the background to run.

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

[0005] The purpose of the present 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 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; determining the second display interface as an 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 suspension, and whether to display in full screen.

[0010] In a 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 a possible implementation of the first aspect above, the method also 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 a 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 a possible implementation of the first aspect above, the method also includes: in response 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 a possible implementation of the first aspect above, detecting a first display interface and a second display interface on which a first application is currently running includes: detecting the same first display component instance and second display component instance, and determining that 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 state 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 state attribute information of the first display interface, determining that the first display interface is displayed in the background; based on the second state attribute information of the second display interface, determining that the second display interface is displayed in the foreground.

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

[0019] In a 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 corresponding to the first refresh event, refreshing the second display interface, it also includes: starting a 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 startup operation.

[0020] In the 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 on which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes any one of the methods 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 implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

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

[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 an interface change 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 an activity of an electronic device during an interface change process 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 objectives, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and comprehensively described below in conjunction with the accompanying drawings.

[0039] It can be understood that for the sake of ease 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 (i.e., 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 mentioned above, when an electronic device runs the same application interface in the foreground and the background at the same time, if the display interface of the application needs to be refreshed, the problem of interface jump will occur. It can be understood that this problem is related to the same display interface of the same application having the same Activity (as an example of a display component) name, which will be described in detail below.

[0041] The present application does not limit the specific form of the electronic device, and the electronic device can be any device that supports the column display function. For example, the electronic device can be a foldable mobile phone, a laptop computer, a tablet, a large-screen device, a wearable device (for example, 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 mobile phone as an example of an electronic device.

[0042] Let's combine Figures 2a to 2k The following is a schematic diagram of the interface changes in the scenario of abnormal interface jump, which introduces the above interface jump problem in detail.

[0043] Figure 2aAccording to an embodiment of the present application, a global search interface 20a of an electronic device 100 is shown. The interface 20a includes a search box 201. In addition, in response to a user inputting and searching for "software update" in the search box 201 through an input method application, the interface 20a also includes a quick entry for online search of "software update" provided by a browser application, and search results within the device. The search results include: an entry 2011 of a software update application, etc.

[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 Figure 2b The software update application main interface 20b shown. 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 displays 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, he can swipe up to return to the desktop user interface, and the software update application will switch from the foreground display state to the background operation. If the user wants to update the system software when the software update application is running in the background, he 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 setting application is shown. Figure 2e As shown, the user interface 20e includes a setting item list interface 205 (one of the display interfaces of the setting application). The setting item list interface 205 includes buttons for various setting items, such as controls for setting items such as battery, storage, security, privacy, healthy use of mobile phone, smart assistant, folding screen area, auxiliary functions, users and accounts, system and update.

[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 setting item list interface 205 and a system and update interface 206 (one of the display interfaces of the setting application). The system and update interface 206 includes a startup entry for the software update application, namely a "software update" control 2061. That is, when the user clicks the "software update" control 2061, the software update application can be started.

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

[0050] After the software update application detects a new version of the system software, it displays the following Figure 2h The user interface 20h shown in FIG. 20h. The new version interface 208 of the software update application can refer to the above Figure 2c The user can click 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...", 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, such as 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 20k shown. Figure 2b In the user interface 20b and the user interface 20k shown, there is no text message of "checking" and the like, 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 searched, 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 The user interface 201 shown in FIG. 201 includes application icons of multiple applications, such as a setting application, a clock application, a browser application, etc., and a system "software update" notification box 212. The "software update" notification box 212 includes a prompt message "xxxxx is available for your device", a "later" control 2121, a "details" control 2122, and a "download and install" control 2123. The user can open the software update application and enter the new version interface of the software update application by clicking the "download and install" control 2123.

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

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

[0062] It can be understood that Activity is a component responsible for interacting with the user, displaying the interface, and monitoring 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 in response. The screens mentioned here are not necessarily complete and independent display screens. Taking "two screens" as an example, the two screens may be two independent display areas in a complete display screen. Of course, if the terminal has two or more independent display screens, the "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 displays 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, several activities of the same application will be stored in the same task stack. In the column display mode, when different display columns are used to display the interfaces of different applications, the activities of different applications also need to be in the same task stack.

[0065] For example, Figure 1a The interface 11 of the setting application corresponds to Activity 2 and the interface 12 of the software update application corresponds to Activity 1 in the task stack of the setting application (hereinafter referred to as setting TASK). Figure 1c The interface 14 of the software update application shown corresponds to Activity 1 which also exists 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 is combined with the above Figures 2a to 2k The following is a schematic diagram of interface changes, introducing the corresponding Activity changes.

[0067] For example, Figures 3a to 3i Shows a Figures 2a to 2k The diagram shows the changes of 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 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 When the new version interface 20c is shown, since the new version check is monitored by Activity A corresponding to the main interface 20b of the software update application 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 display interface in the foreground.

[0070] like Figure 3c As shown, the electronic device 100 displays Figure 2e When the user interface 20e of the setting application is shown, since the setting application is opened, the interface of the setting application will be displayed, so a setting TASK will be created, and an Activity C for displaying the setting item list interface 205 will be created in the setting 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 is not destroyed, and the electronic device 100 includes Activity A and Activity B in the OUC TASK, and Activity C in the setting TASK, and Activity C in the setting TASK corresponds to the display interface of the foreground.

[0071] like Figure 3d As shown, the electronic device 100 displays Figure 2fThe user interface shown is that 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 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 of the setting TASK, and Activity C and Activity D 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 Activity in the OUC TASK has not been destroyed, the electronic device 100 includes Activity A and Activity B in the OUC TASK, and Activity C and Activity D in the setting TASK.

[0072] like Figure 3e As shown, the electronic device 100 displays reference Figure 2g When the main interface 207 of the software update application is shown, since the user clicks the "Software Update" control 2061, it is monitored by Activity D of the system and update interface 206 of the setting application in the setting TASK, and the setting application is in the column display mode, the main interface 207 of the software update application needs to be displayed on the display interface of the setting application, so Activity A for displaying the main interface 207 of the software update application is created on 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 Activity in the OUC TASK has not been destroyed, the electronic device 100 includes Activity A and Activity B in the OUC TASK, and Activity A, Activity C and Activity D in the setting TASK. Furthermore, 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 setting TASK, Activity B for displaying the current new version interface 208 is created on Activity A in the setting TASK, and Activity C and Activity B 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 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 A, Activity B, Activity C and Activity D in the setting 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 setting 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 setting TASK, the redrawn new version interface 209 still corresponds to Activity B in the setting 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 with a prompt of "Download Failed", that is, the Activity instance corresponding to the refresh event is started 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 so, the Activity instance corresponding to the refresh event in the task stack of the software update application displayed in full screen will be directly started. 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 software update application displayed in full screen is a background application, and there is an instance of Activity B corresponding to the new version interface of the software update application in the task stack of the setting application displayed in the foreground, the electronic device will still automatically start the instance of Activity B corresponding to the new version interface of the software update application displayed in full screen, refresh the new version interface 208 corresponding to the Activity instance, and display a pop-up window with a prompt of "Download failed". As a result, the user interface will suddenly switch from 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. 20j is shown in FIG. 20j, and Activity B in OUC TASK corresponds to the display interface in the foreground. It can be understood that since the setting application is running in the background at this time, that is, the Activity in the setting TASK is not destroyed, the electronic device 100 includes Activity A and Activity B in OUC TASK, and Activity A, Activity B, Activity C and Activity D in the setting 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 OUC TASK on the top of the stack, and destroys other Activity instances (such as Activity B) in OUC TASK, displays the main interface of the software update application 20k displayed in full screen, and Activity A in OUC TASK corresponds to the display interface in the foreground. It can be understood that since the setting application is still running in the background at this time, that is, the Activity in the setting TASK has not been destroyed, the electronic device 100 includes Activity A in OUC TASK, as well as Activity A, Activity B, Activity C and Activity D in the setting TASK.

[0078] Since the new version check monitoring of the instance of Activity A corresponding to the main interface of the software update application displayed in columns created later will overwrite the new version check monitoring of the instance of Activity A corresponding to the main interface of the software update application displayed in 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 columns 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 main interface of the software update application displayed in full screen, because the electronic device 100 calls back the instance of Activity A corresponding to the main interface of the software update application displayed in columns to check the new version, the new version check is not implemented by the instance of Activity A corresponding to the main interface of the software update application displayed in full screen, but by the instance of Activity A corresponding to the main interface of the software update application displayed in columns. Figure 2b In the user interface 20b and the user interface 20k shown, there is no text message of "checking" and the like, and the "check for updates" control 211 is also in a clickable state.

[0080] And, if 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 of the 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 as shown Figure 2h The user interface 20h shown in the figure is used, and Activity C and Activity B in TASK are set to correspond to the display interface of the foreground. 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 only takes the setting application and the update application 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 setting application, Activity B can be SystemUpdateActivity corresponding to the system and update interface of the setting application, Activity C can be MainEntranceActivity corresponding to the main interface of the software update application, and Activity D can be FirmwareNewVersionActivity corresponding to the new version interface of the software update application. In other embodiments, the above-mentioned setting application and software update application 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 the electronic device generates a display interface, it creates an Activity instance corresponding to the display interface, and determines the state attributes (foreground state attributes and / or column state attributes) of the Activity instance, that is, 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 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 been created with a foreground state attribute as the foreground attribute, the target Activity instance displayed in the foreground is directly notified to refresh the interface. Or for example, if it is determined that a target Activity instance has been created with a foreground state attribute as the background attribute, the target Activity instance running in the background is started to refresh the interface.

[0084] For example, for Figures 2a to 2k In the scenario shown, the electronic device will also create an Activity instance set for managing the Activity instances that have been 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 in the figure 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 setting 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. Then the electronic device 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, reference Figure 4a As can be understood, compared to the user interface 40a shown in 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] Furthermore, 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 information: 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 abnormal jumps of the user interface will not occur, thereby improving the user experience.

[0091] For example, Figure 4b According to an 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 in the figure 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: 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.

[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: Obtain state 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 can be 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] Exemplarily, 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 used as the interface to be refreshed. In addition, 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 also include column state attributes (eg, column display or full screen display).

[0105] If the column state attribute of the first display interface is column display and the column state 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 directly refreshed, 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, storing the Activity instances of each application in an Activity instance set, and recording the state attributes (foreground state attributes and / or column state attributes) of each Activity instance. In addition, a refresh callback interface is added to the Activity instance set, which is used to implement the processing refresh message callback method onHandlerMessage when receiving an interface refresh notification, so that the target Activity can process the interface refresh.

[0109] When an interface refresh event is detected, first determine whether there is a target Activity instance corresponding to the interface refresh event in the Activity instance set. If the target Activity instance exists in the Activity instance set, then continue to determine whether there is a target Activity instance whose foreground state attribute is the 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 is notified to refresh the interface through the refresh callback interface. In addition, it is possible to further determine whether the column state attribute of the target Activity instance displayed in the foreground is a 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 is notified to refresh the interface through the refresh callback interface.

[0111] If there is no target Activity instance whose foreground state attribute is the foreground state, that is, the target Activity instance only exists in the background, the target Activity instance is started through the startActivity method, and the target Activity instance running in the background returns to the foreground, is 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, and the present application does not impose any restrictions on this.

[0114] The following takes the example of independently managing the Activity instances of various applications in the electronic device by the Activity instance set as an example to introduce in detail the implementation method of defining the Activity instance set in the electronic device 100.

[0115] Specifically, the electronic device 100 may use a HashMap to store the created Activity instances in the form of key-value pairs, where the key is the name of the Activity instance and the value is the object list of the Activity instance, that is, the object list of the Activity instance may 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 whether there is a target Activity instance to be created in the Activity instance set. 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 through 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 there are already created Activity instances. Then check 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 exists, it will not be added repeatedly. Otherwise, the target Activity instance to be created will be added to the Activity instance list.

[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] Exemplarily, creating an Activity instance can be implemented by the following code: calling the add instance method of the Activity manager class in the onCreate method of the target Activity instance:

[0125]

[0126] Among them, onCreate represents the onCreate method, and ActivityTaskManager.putActivityToMap represents the method of adding an instance 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 through 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] Exemplarily, destroying an Activity instance can be implemented by the following code: calling the delete instance method of the Activity manager class in the onDestroy method of the target Activity instance:

[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 the 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 new version 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 the present 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 foreground is displayed, and the column state attribute is used to indicate whether the column is displayed. For example, the foreground state attribute may include: foreground attribute (e.g., foreground display), background attribute (e.g., background display). The column state attribute may include: column display attribute (e.g., column display), 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 suspended, a full-screen state attribute for indicating whether the display is full-screen, etc., and the present application does not impose any limitation on this.

[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 by 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 in the figure 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: An interface refresh event is detected, and a target Activity corresponding to the interface refresh event is determined.

[0147] The electronic device 100 detects an interface refresh event, such as the aforementioned Figure 4a The download failure pop-up window shown in the figure 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, in which an Activity instance set is defined for storing Activity instances that have been 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 existing Activity instance list from the Activity instance set by the name of the target Activity instance. If the returned existing Activity instance list is not empty, it means that there are one or more target Activity instances that have been created; if the returned existing Activity instance list is empty, it means that there is no target Activity instance that 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 will not be repeated here.

[0157] For example, the interface refresh event is a pop-up window of download failure, and the target Activity is FirmwareNewVersionActivity corresponding to the new version interface of the software update application. If the created target Activity does not exist in the current electronic device, the current display interface of the electronic device 100 may be as follows: Figure 2d The desktop 20d shown in FIG. 10a may 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 may 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 whose foreground state attribute is a foreground attribute in the Activity instance list corresponding to the target Activity name.

[0160] In some embodiments, if the judgment result is yes, it means that there is a target Activity whose foreground state attribute is 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 some other embodiments, if the judgment result is no, indicating that there is no target Activity whose foreground state attribute is the foreground attribute, then step S507 is executed to start the target Activity, draw and display the target interface.

[0162] Exemplarily, the electronic device 100 can determine whether there is a target Activity instance whose foreground state attribute is the foreground attribute (for example, the foreground attribute value is true) in the Activity instance list corresponding to the target Activity name. If so, the target Activity instance whose foreground state attribute is the foreground attribute is returned; if not, a null value is returned.

[0163] It can be understood that in other embodiments, if the judgment result is yes, it means that there is a target Activity with a foreground state attribute of the foreground attribute, and step S505 may not be executed, but 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 of the foreground attribute is the target Activity of the column interface, the target Activity instance with a foreground state attribute of 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 whose foreground state attribute is the foreground attribute in the Activity instance set, it continues to determine whether the column state attribute of the target Activity whose foreground state attribute is the foreground attribute is the column display attribute.

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

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

[0168] Exemplarily, the electronic device 100 can 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 a 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 a foreground attribute in the Activity instance set, and notifies the target Activity to draw and display a 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 whose foreground state attribute is the foreground attribute and the column state attribute is the column display attribute that has been created in the current electronic device. 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 whose foreground state attribute is the foreground attribute and the column state attribute is the full screen display attribute that has been created in the current electronic device. The current display interface of the electronic device 100 can be as follows: Figure 6 The user interface 60a shown in FIG. 60a includes "Downloading...", version information of the new version, an "Update Log" display box, and a "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 Figure 6 The user interface 60a shown jumps to Figure 2j User interface 20j is shown.

[0174] Specifically, the method of 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 processing callback method onHandlerMessage through the refresh callback interface RefreshListener defined in the Activity manager class, so that the target Activity can process 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 that needs 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 a 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, the interface refresh event is a pop-up window of download failure, and the target Activity is FirmwareNewVersionActivity corresponding to the new version interface of the software update application. The foreground state attribute of the target Activity in the current electronic device is the background attribute. The current display interface of the electronic device 100 can be as follows: Figure 2d The desktop 20d shown in FIG. 10a may 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 may 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 whose foreground state attribute is the foreground attribute in the Activity instance set, and the column state attribute of the target Activity instance whose 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 a download failure pop-up window and the target Activity as FirmwareNewVersionActivity corresponding to the new version interface of the software update application as an example, there is a target Activity instance whose foreground state attribute is the foreground attribute and whose column state attribute is the full screen display attribute that has been created in the current electronic device, and the current display interface of the electronic device 100 can be as follows: Figure 6 The user interface 60a shown in FIG. 60a includes "Downloading...", version information of the new version, an "Update Log" display box, and a "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 Figure 6 The user interface 60a shown jumps to Figure 2j It can be 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, and this application does not limit this.

[0187] In summary, the display method provided in 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 in 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 According to an embodiment of the present application, a structural schematic diagram of an electronic device 100 is shown.

[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 is to be understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure 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 (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The processor 110 can be used to execute the display method provided in the embodiment of the present application.

[0193] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[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 , the mobile communication module 160 , and the like.

[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 in 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 etc. applied on the electronic device 100 .

[0200] The audio module 170 is used to convert digital audio information into analog audio signal output, and also used to convert analog audio input into digital audio signal. 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 1 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 realize the shooting function through ISP, camera 191, video codec, GPU, display screen 192 and 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 codes, which include 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 may 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 may 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 exemplified.

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

[0211] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, 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 camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0214] In addition, the application package may also include: main 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 the screen is slid 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 certain page of the application (such as payment code), instant information and reminders (express information, expenditure information, commuting conditions, taxi travel information, schedule information, etc.) and attention dynamics (football stands, basketball stands, stock information, etc.). In some embodiments, the user can search for the application name through the global search and open the application, or open the corresponding application through the quick entry of the application.

[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 the 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 of the notification center.

[0218] The application framework layer provides an application programming interface (API) and a 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 Task, Memory, Service, Process, APP, etc.); it provides corresponding interfaces for obtaining activity-related information.

[0221] Among them, Activity is a display component of an Android APP. Activity provides a window to interact with the user 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 an 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 a page for checking new versions.

[0222] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, 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 controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can 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 connecting, hanging up, etc.).

[0226] The resource manager provides various resources for the application, such as localized strings, icons, images, user interface layout files (layout xml), video files, fonts, colors, user interface module (UI component) identity documents (ID), etc. In addition, the resource manager is used to uniformly manage the aforementioned resources.

[0227] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[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 and the target Activity with the foreground state attribute is set as 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 service (systemserver). Its main function is to encapsulate a series of policy interfaces by combining multiple data modules inside the service, embed the piling process in the process of starting, managing, and displaying the Activity in the native application framework layer, and execute the policy of refreshing the display interface. Among them, the piling process refers to the code used to replace the associated code or the unimplemented code, that is, to write or generate the stub code. One of the uses of the piling process is to set the behavior of the policy-related code of refreshing the display interface during testing to meet the test requirements.

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

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

[0232] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0233] The system library may 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 the fusion of 2D and 3D layers for multiple applications.

[0235] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. 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 contains at least display driver, camera driver, audio driver, and sensor driver.

[0239] The various embodiments of the mechanism disclosed in the present 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 may be applied to input instructions to perform the functions described herein and to generate output information. The output information may 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 high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific 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, machine-readable media 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 disks, 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 tangible machine-readable memories 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 include 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 specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, 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 structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these 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 method 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 proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules 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 only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0246] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to 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 present 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; Acquire 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 suspension, whether to display in full screen.

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, characterized in that: 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 that the first display interface and the second display interface of the first application are 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: Based on the third state attribute information of the first display interface, determining 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 a method for starting a display component; The second display component instance refreshes the second display interface in response to the start-up 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 the electronic device, and is used 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

  • System upgrading method and related device

    CN116088695A

  • Application display method, electronic equipment and storage medium

    CN116302291A

  • Small program page adaptation method, electronic equipment, medium and program product

    CN116521289A