Method for displaying an upgrade wizard interface and related device
By decoupling the Activity and Fragment lifecycles of the upgrade wizard application, the problem of the upgrade wizard interface not being displayed after an electronic device version upgrade is solved, ensuring that users can view the new features, improving user experience and reducing resource consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-27
- Publication Date
- 2026-06-30
Smart Images

Figure CN122308982A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method for displaying an upgrade wizard interface and related equipment. Background Technology
[0002] Electronic devices can offer a variety of service functions. New service functions can be added to electronic devices by downloading new version packages.
[0003] In a possible implementation, the electronic device can be restarted after a successful version upgrade. After the electronic device is powered on, it can display startup wizard information and / or upgrade wizard information to inform or guide the user to quickly understand and use the new service functions. The new service functions can be newly added services or improved versions of existing services.
[0004] However, in a possible implementation, after the upgrade, the electronic device may not be able to display the upgrade wizard interface; if the user does not see the upgrade wizard, the user will not be able to understand what new service functions have been added after the upgrade, thus affecting the user experience. Summary of the Invention
[0005] This application provides a method and related device for displaying an upgrade wizard interface, which is applied in the field of terminal technology. After an electronic device undergoes a version upgrade, the electronic device can continue to display the upgrade wizard interface to the user in a scenario where the screen is off and then on again. This prevents the user from missing the introduction of the newly added service functions due to the inability to draw subsequent upgrade wizard interfaces, thereby improving the user experience.
[0006] In a first aspect, embodiments of this application propose a method for displaying an upgrade wizard interface, applied to an electronic device. The electronic device includes an upgrade wizard application. The method includes: when the electronic device upgrades from a first version to a second version, the electronic device starts the upgrade wizard application; the upgrade wizard application creates a first activity; the first activity corresponds to multiple fragments; the lifecycle of the multiple fragments depends on the lifecycle of the first activity, and any fragment among the multiple fragments corresponds to an upgrade wizard interface; the upgrade wizard interface is used to guide the user to understand the new service functions added in the second version compared to the first version; the upgrade wizard application renders a first interface based on the first activity and the first fragment; the upgrade wizard interface includes the first interface; the first fragment corresponds to the first interface; if no user operation is received within a preset time, the electronic device enters a screen-off state; the upgrade wizard application triggers... Configuration change event; the configuration change event is used to indicate that the system configuration of the electronic device has changed; the upgrade wizard application separates the first Activity and multiple Fragments; the lifecycle of the multiple separated Fragments no longer depends on the lifecycle of the first Activity; in response to the screen-on operation, the electronic device enters the screen-on state; in response to the configuration change event, the upgrade wizard application destroys the first Activity and creates a second Activity after restarting; the second Activity is different from the first Activity; after destroying the first Activity, the upgrade wizard application retains multiple separated Fragments; the upgrade wizard application displays a second interface based on the second Activity, the separated first Fragment, and the separated second Fragment; the second Fragment corresponds to the second interface, which is the interface that is preset to be displayed after the first interface in the upgrade wizard interface.
[0007] In this way, even if the screen turns off and then on again during the upgrade wizard process, the electronic device can continue to display the upgrade wizard interface to the user. This prevents the user from missing the introduction of the new service functions due to the inability to draw subsequent upgrade wizard interfaces, thereby improving the user experience.
[0008] Optionally, the upgrade wizard application may separate the first Activity and multiple Fragments, including: the upgrade wizard application calling the detach() method to separate the first Activity from any of the multiple Fragments; the separated Fragment has its own lifecycle, and the lifecycle of the separated Fragment is different from that of the first Activity.
[0009] In this way, electronic devices can decouple the Activity from multiple Fragments, so that when the Activity is destroyed and restarted, the Fragment will not be destroyed along with the Activity, thus avoiding the problem of not being able to find the Fragment when the screen is on to display the subsequent upgrade wizard interface.
[0010] Optionally, the electronic device includes a configuration file containing attribute information for a preset configuration change event. This attribute information is used to prevent the Activity from being destroyed and restarted when the preset configuration change event is triggered. After the electronic device enters a screen-off state, the device also includes: an upgrade wizard application checking whether the configuration file contains the attribute information for the configuration change event; and the upgrade wizard application separating the first Activity and multiple Fragments, including separating the first Activity and multiple Fragments if the configuration file does not contain the attribute information for the configuration change event.
[0011] In this way, electronic devices can determine whether configuration change events can be avoided. If not, they can implement a solution that separates Activities and multiple Fragments, reducing the problem of the upgrade wizard interface not being displayed after the screen is turned on.
[0012] Optionally, after the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file, it also includes: in response to the screen-on operation, the electronic device enters the screen-on state; if the configuration change event attribute information is included in the configuration file, the upgrade wizard application does not process the configuration change event based on the configuration change event attribute information; the upgrade wizard application displays the second interface according to the first Activity, the first Fragment, and the second Fragment.
[0013] In this way, when the config change event is a default event, the electronic device can avoid Activity restart through attribute information, and can continue to display the upgrade wizard interface so that users can understand the new service features added after the version upgrade. This method is also relatively simple, reduces resource consumption during interface redrawing, and allows for quick display of the upgrade wizard interface after the screen lights up, minimizing time delays.
[0014] Optionally, before the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file, the following steps are also included: the upgrade wizard application detects whether the first Activity has entered the OnStop lifecycle; the OnStop lifecycle is used to reflect that the electronic device has entered the screen-off state; the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file, including: when the first Activity is detected to have entered the OnStop lifecycle, the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file.
[0015] In this way, electronic devices can use the `onStop` lifecycle method to determine whether there is a risk of the upgrade wizard interface failing to display due to a screen-off scenario. The duration of the `onStop` lifecycle method is also sufficient to allow the upgrade wizard application to handle the separation process of Activity and multiple Fragments. Simultaneously, the electronic device can also use the `onStop` lifecycle method to determine whether the upgrade wizard application is executing the normal process under screen-on conditions or the process of displaying the upgrade wizard interface under screen-off conditions.
[0016] Optionally, the first interface may also be used to indicate whether to display the second interface; the display process of the second interface depends on the second Fragment and the first Fragment of the first interface.
[0017] Optional features include: upon exiting the upgrade wizard application, the system reclaims the second Activity and multiple detached Fragments; the system uses this to manage memory.
[0018] In this way, if the lifecycle of the separated Fragment is not destroyed along with the Activity, the electronic device can automatically reclaim the separated Fragment when exiting the upgrade wizard application, without consuming additional power to process the separated Fragment.
[0019] Optionally, the electronic device also includes a boot wizard application; before the electronic device opens the upgrade wizard application, it further includes: the boot wizard application determining whether there is a protocol change in the second version; the protocol change is used to instruct the boot wizard application to display an interface related to the protocol change; the electronic device opening the upgrade wizard application includes: if there is no protocol change in the second version, the boot wizard application launches the upgrade wizard application; after the electronic device opens the upgrade wizard application, it further includes: the upgrade wizard application determining whether a highlight recommendation interface needs to be displayed, the upgrade wizard interface including a highlight recommendation interface; the highlight recommendation interface is used to display multiple newly added service functions in the same interface; the upgrade wizard interface also includes multiple application promotion interfaces; any application promotion interface is used to display the newly added service function corresponding to an application; in the preset display order in the upgrade wizard interface, any application promotion interface is located after the highlight recommendation interface; the upgrade wizard application renders the first interface based on the first Activity and the first Fragment, including: if the upgrade wizard application needs not to display the highlight recommendation interface, the upgrade wizard application renders the application promotion interface based on the first Activity and the first Fragment.
[0020] In this way, without needing to display the protocol change interface and the highlight recommendation interface, when the electronic device's screen turns off and then on again, the device can handle the config change event by changing configuration attributes or separating the Activity and Fragment. This reduces the problem of the electronic device not displaying subsequent application promotion interfaces, thereby improving the user experience.
[0021] Optionally, the upgrade wizard application renders the first interface based on the first Activity and the first Fragment, and further includes: when the upgrade wizard application needs to display a highlight recommendation interface, the upgrade wizard application renders the highlight recommendation interface based on the first Activity and the first Fragment.
[0022] In this way, when it is not necessary to display the protocol change interface but it is necessary to display the highlight recommendation interface, after the electronic device screen turns off and on again, the electronic device can handle the configuration change event by changing the configuration attribute or separating the Activity and Fragment. This reduces the problem of the electronic device not displaying the application promotion interface, thereby improving the user experience.
[0023] Secondly, embodiments of this application provide a display device for an upgrade wizard interface. This display device can be an electronic device, or a chip or chip system within an electronic device. The display device can include a display unit and a processing unit. When the display device is an electronic device, the display unit can be a display screen. The display unit performs display steps to enable the electronic device to implement the upgrade wizard interface display method described in the first aspect or any possible implementation of the first aspect. When the display device is an electronic device, the processing unit can be a processor. The display device can also include a storage unit, which can be a memory. The storage unit stores instructions, and the processing unit executes the instructions stored in the storage unit to enable the electronic device to implement the upgrade wizard interface display method described in the first aspect or any possible implementation of the first aspect. When the display device is a chip or chip system within an electronic device, the processing unit can be a processor. The processing unit executes the instructions stored in the storage unit to enable the electronic device to implement the upgrade wizard interface display method described in the first aspect or any possible implementation of the first aspect. The storage unit can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip within the electronic device (e.g., a read-only memory, random access memory, etc.).
[0024] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory is used to store computer execution instructions, and the processor is used to run the computer execution instructions stored in the memory to perform the method described in the first aspect or any possible implementation of the first aspect.
[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0026] Fifthly, embodiments of this application provide a computer program product including a computer program, which, when run, causes the computer to perform the method described in the first aspect or any possible implementation thereof.
[0027] Sixthly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the methods described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.
[0028] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).
[0029] It should be understood that the second to sixth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the upgraded interface provided in the embodiments of this application;
[0031] Figure 2 This is a flowchart illustrating a possible implementation where the upgrade wizard interface cannot be displayed.
[0032] Figure 3 This diagram illustrates the data dependencies between multiple upgrade wizard interfaces.
[0033] Figure 4 This is a schematic diagram of another possible implementation where the upgrade wizard interface cannot be displayed.
[0034] Figure 5 A flowchart illustrating a method for displaying an upgrade wizard interface provided in an embodiment of this application;
[0035] Figure 6 This is a schematic diagram of the structure of the Fragment stack provided in the embodiments of this application;
[0036] Figure 7 A flowchart illustrating a method for displaying an upgrade wizard interface provided in an embodiment of this application;
[0037] Figure 8 A flowchart illustrating another method for displaying an upgrade wizard interface provided in an embodiment of this application;
[0038] Figure 9 This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application;
[0039] Figure 10 A software structure block diagram of the electronic device 100 provided in the embodiments of this application;
[0040] Figure 11 A flowchart illustrating a method for displaying an upgrade wizard interface provided in an embodiment of this application;
[0041] Figure 12 This is a schematic diagram of the structure of a display device for an upgrade wizard interface provided in an embodiment of this application. Detailed Implementation
[0042] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0043] 1. Electronic equipment
[0044] The electronic devices in this application embodiment may include handheld devices, vehicle-mounted devices, etc., that have a display upgrade wizard interface. For example, some electronic devices include: mobile phones, tablets, handheld computers, laptops, mobile internet devices (MIDs), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, in-vehicle devices, electronic devices in 5G networks, or electronic devices in future evolved public land mobile networks (PLMNs), etc., and the embodiments of this application are not limited to these.
[0045] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.
[0046] In this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0047] 2. Other
[0048] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0049] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0050] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0051] In a possible implementation, if the version upgrade is successful, the electronic device can display startup wizard information and / or upgrade wizard information after restarting to inform or guide the user to quickly understand and use the new service functions.
[0052] The following example uses a mobile phone as an electronic device, and combines... Figure 1 This section introduces the interface of the upgraded electronic device. For example... Figure 1 As shown:
[0053] Electronic devices can obtain new version packages from over-the-air (OTA) servers and install and configure them accordingly. To ensure the stable operation of newly added service functions, electronic devices can be restarted to apply and activate the relevant configurations for the new service functions.
[0054] After powering on, the electronic device can launch a startup wizard application, which provides startup wizard information that can help users configure the electronic device when starting it for the first time or after upgrading the device.
[0055] The startup wizard application can check if there are any protocol changes in this version upgrade. If there are protocol changes, the electronic device may display, for example... Figure 1 The protocol change interface is shown as 'a' in the image. This interface may include notifications about the protocol changes to inform users that the new version modifies the agreement; the agreement may include the user's privacy policy, terms of service, version information, etc. For example, in... Figure 1 In the interface shown in 'a', the notification information for protocol changes may include, for example, a software update service statement, a system manager basic service statement, a self-discovery service statement, or a mobile network service statement.
[0056] The protocol change interface also includes a "Next Step" control 101, which is used to proceed to the next step of the process. For example, in response to a trigger operation on the "Next Step" control 101, the electronic device can launch an upgrade wizard application. This application provides upgrade wizard information to help users understand how to quickly use the newly added service features. The upgrade wizard application can check if there are any highlighted features among the multiple newly added service features. If highlighted features are found, the electronic device can display information such as... Figure 1 The interface shown in b is shown in the image.
[0057] Figure 1 The interface shown in b is the highlight page, which can be used to display multiple new service features on the same screen. Users can quickly understand which highlights are involved in this version update based on this interface.
[0058] Figure 1 The interface shown in b may include a highlight icon 102, highlight prompt information 103, a page indicator 104, and a confirmation control 105. Highlight icon 102 is an animated illustration of the highlighted function; highlight icon 102 corresponds to highlight prompt information 103, which explains highlight icon 102. The new version may include multiple highlight services to be recommended. Figure 1 The interface shown in b can display multiple highlight icons 102 and highlight prompts 103; the electronic device can switch between the icons and prompts of the highlight services via the page indicator 104. For example, in response to a left swipe operation on the page indicator 104, the electronic device can... Figure 2 The interface shown in b displays the highlight icon 102 and highlight prompt information 103 for the next highlight service.
[0059] A confirmation control 105 can be used to proceed to the next step of the process. The confirmation control 105 may be, for example, a control labeled "OK". In response to a triggering action on the confirmation control 105, the electronic device can interact with applications related to the newly added service features through the upgrade wizard application, thereby displaying an application promotional interface related to that application.
[0060] For example, taking the interaction between the upgrade wizard application and the AnyDoor application as an example, the electronic device can display something like... Figure 1 The interface shown in c is shown in the image. Figure 1 In the interface shown as c, the electronic device can display an application promotion interface for the Any Door function. The application promotion interface may include: application promotion illustration 106, application promotion information 107, trial control 108, function activation control 109, and function deactivation control 111, etc.
[0061] Application promotional illustration 106 can be an animated illustration used to show how to use the newly added service function; application promotional information 107 can be used to introduce the newly added service function; trial control 108 can be used to quickly launch the newly added service function and allow users to try it out; enable function control 109 can be used to enable the newly added service function; disable function control 111 can be used to disable the newly added service function.
[0062] Electronic devices can display multiple application promotion interfaces, and different application promotion interfaces can correspond to different service functions of different applications. Examples will not be given in this application.
[0063] In some scenarios, electronic devices may not display the startup wizard interface. For example, if the startup wizard application determines that there have been no changes to the protocol in this version upgrade, the electronic device can skip the protocol change interface after startup and display the highlight recommendation interface and / or application promotion interface.
[0064] In some scenarios, electronic devices may not display the featured recommendation screen. For example, if the upgrade wizard app detects that the featured recommendation screen is not needed (e.g., the new version has minor changes and no particularly outstanding features), the electronic device may skip the featured recommendation screen and display the app's promotional screen.
[0065] In some scenarios, after the application promotion interface is displayed, the electronic device can show the desktop, such as... Figure 1 The interface shown in d; or the electronic device first displays the boot animation interface (not shown in the figure) and then displays the desktop after exiting the boot wizard application.
[0066] After the upgrade, electronic devices can showcase the new service features to users through the aforementioned highlight recommendation interface and application promotion interface. However, in a possible implementation, after the upgrade, the electronic device may not be able to display the upgrade wizard interface; users will not be able to view the upgrade wizard information.
[0067] For example, in a nighttime scenario, electronic devices might have an automatic version update function enabled. When a new version is detected, the device can automatically update to the latest version. Afterward, the device can complete the update and restart. In the absence of protocol changes, the electronic device, upon powering on, may display, for example... Figure 1 The highlight recommendation interface shown in b is or Figure 1 The application promotion interface is shown as 'c' in the image. Because users may not be able to see the upgrade wizard information in a timely manner during nighttime scenes, electronic devices will keep... Figure 1 The interface shown in b or Figure 1 After a period of time, the interface shown in 'c' enters a screen-off state.
[0068] For example, after upgrading to a new version, the electronic device can restart and configure the new version. With the lock screen function enabled, the electronic device can display the lock screen interface after configuration, with highlight recommendations or application promotion interfaces located below the lock screen interface; after unlocking the screen, the electronic device can display, for example... Figure 1 The interface shown in b or Figure 1 The interface shown in 'c' is shown in the image. However, in practical applications, the configuration process often takes a long time, and users may not pay attention to the configuration process continuously. Therefore, after the lock screen is displayed, the electronic device may enter a screen-off state because it has not received an unlock operation for a long time.
[0069] When the screen is off, the electronic device will turn on when the user performs a screen-on operation. However, in this case, the electronic device will not display the featured recommendation interface or application promotion interface, causing the user to not see the relevant information of the newly added service functions, thus reducing the user experience of using the newly added service functions.
[0070] In possible implementations, there may be other scenarios that cause electronic devices to fail to display upgrade wizard information correctly, which will not be listed here.
[0071] The following example uses an abnormal scenario, specifically the screen-off scenario, and combines it with... Figures 2-4 We analyze the possible reasons why electronic devices may fail to display upgrade wizard information correctly during implementation.
[0072] A scenario where an electronic device fails to display upgrade wizard information correctly could be as follows: Figure 2 As shown:
[0073] S201. The electronic device has restarted and successfully upgraded.
[0074] After the version package is downloaded and installed, the electronic device can be restarted. After restarting, the electronic device can configure the new version. For example, a progress bar will be displayed during the configuration process. When the progress bar reaches 100%, the upgrade is successful.
[0075] S202. The startup wizard application checks for any protocol changes.
[0076] The version package information may include instructions indicating whether the protocol has changed. The boot wizard application can determine whether there have been any protocol changes based on the version package information. If the protocol has changed, the following will be displayed: Figure 1 The protocol change interface is shown as 'a' in the diagram. Alternatively, if no protocol change exists, proceed to step S203.
[0077] S203. In the absence of any protocol changes, the upgrade wizard application creates an activity.
[0078] An Activity can be used to manage the interfaces displayed in an upgrade wizard application, such as a featured recommendation interface and an application promotion interface. An Activity can correspond to multiple Fragments; a Fragment can be a modular UI component embedded in an Activity, used to build flexible and dynamic user interfaces. For example, an upgrade wizard application may include multiple interfaces, such as a featured recommendation interface and / or multiple application promotion interfaces. Any Fragment can correspond to a featured recommendation interface or an application promotion interface, and this Fragment can be used to manage the UI of the corresponding interface.
[0079] S204, The upgrade wizard application determines whether to display featured features.
[0080] The version package may include instructions for indicating whether to display featured features. The upgrade wizard application can determine whether to display the featured feature recommendation interface based on the information in the version package. If it is necessary to display featured features, the upgrade wizard application can execute step S401. Alternatively, if it is not necessary to display featured features, it can execute step S205.
[0081] S205. If there is no need to display highlight features, the upgrade wizard application determines whether it is necessary to access the application's promotional interface.
[0082] The version package may include instructions indicating whether the application's promotional interface needs to be accessed. The upgrade wizard application can determine whether to display the application promotional interface based on the information in the version package. If the application promotional interface needs to be displayed, the upgrade wizard application can execute step S206.
[0083] The version package may include a configuration file. If an application promotional interface needs to be displayed, the configuration file may include the number of application promotional interfaces, the package name of the local application corresponding to each promotional interface, and the interface identifier provided by the application to the upgrade wizard application. The upgrade wizard application can display multiple application promotional interfaces through the above data.
[0084] S206. When it is necessary to access the application's promotional interface, the upgrade wizard application displays the application's promotional interface.
[0085] Application promotional interfaces can be, for example Figure 1 The interface shown in c is an example. The application promotion interface may include promotion interfaces for multiple applications. The application promotion interface displayed in step S206 may be, for example, the first application promotion interface among multiple application promotion interfaces, such as application promotion interface 1.
[0086] S207. After a preset time, the electronic device enters a screen-off state.
[0087] exist Figure 1 In the interface shown as c, if the electronic device does not receive any user interaction within a preset time, the electronic device enters a screen-off state. The preset time can be either the screen automatically turns off time or a screen timeout period.
[0088] S208, after the screen is off, the upgrade wizard application triggers a configuration change event.
[0089] The config change event is used to indicate a change in the system configuration of an electronic device; after a config change event occurs, the Activity is usually destroyed and restarted.
[0090] S209. After the screen is turned on, in response to the config change event, the upgrade wizard application controls the Activity to restart (relunch).
[0091] The upgrade wizard application can destroy the existing Activity and recreate it. A Fragment is attached to an Activity, and its lifecycle is related to the Activity. During the destruction of an Activity, the Fragment is destroyed along with it.
[0092] It is understandable that the destroyed Fragment could be a Fragment from multiple upgrade wizard interfaces.
[0093] S210 An error occurred when restarting the Activity; the upgrade wizard application did not display the application promotion interface.
[0094] After the Activity restarts, the upgrade wizard application may attempt to continue displaying the application's promotional interface. For example, if the electronic device has already displayed application promotional interface 1 in step S206, then in step S210, the upgrade wizard application may attempt to display a second application promotional interface (e.g., application promotional interface 2) and multiple subsequent application promotional interfaces.
[0095] In this situation, the upgrade wizard application cannot obtain all the Fragment data used to manage the second application promotion interface, and the upgrade wizard application cannot continue to display the application promotion interface, resulting in an error. The error message could be something like: Caused by: java.lang.IllegalStateException: Could not find active Fragment with index-1.
[0096] The following is combined Figure 3 Explain the scenarios where Fragment data is missing, such as... Figure 3 As shown:
[0097] After the electronic device powers on, the startup wizard application determines whether to display the protocol change interface based on the version package information. Then, the electronic device can launch the upgrade wizard application. Upon launching the upgrade wizard application, it first generates an entrance page. The entrance page is used by the upgrade wizard application to load necessary resources, set up the application environment, and / or perform other initialization processes. The entrance page can be a user-unobtrusive interface. Afterward, the electronic device can sequentially display a featured recommendation interface and / or one or more application promotional interfaces.
[0098] Application promotional interfaces can be, for example, Application Promotional Interface 1, Application Promotional Interface 2, and Application Promotional Interface 3. Application Promotional Interface 1 corresponds to Application 1, and the Activity of the upgrade wizard application can generate Application Promotional Interface 1 based on the package name of Application 1 and the interface identifier provided by Application 1. Similarly, Application Promotional Interface 2 corresponds to Application 2, and Application Promotional Interface 3 corresponds to Application 3.
[0099] In the upgrade wizard application, data dependencies exist between fragments across multiple screens. For example, when displaying the featured recommendation screen, the Activity can use all fragment data from the featured recommendation screen and a portion of the fragment data from the Entrance Page to create the featured recommendation screen. The portion of the Entrance Page fragment data can include, for example, user data, configuration parameters, and shared resources; these parameters can be used for displaying subsequent screens.
[0100] For example, when displaying application promotion interface 2, the Activity can use all the Fragment data of application promotion interface 2, some of the Fragment data of application promotion interface 1, some of the Fragment data of the highlight recommendation interface, and / or some of the Fragment data of the Entrance Page to obtain application promotion interface 2. It can be understood that during the display process, application promotion interface 2 can be the next interface displayed after application promotion interface 1; application promotion interface 1 can be the next interface displayed after the highlight recommendation interface; that is, the configuration and / or user actions of the previously displayed interface will affect the next displayed interface. Therefore, there are data dependencies between the Fragments of multiple interfaces.
[0101] This process uses the display of a highlight recommendation interface on an electronic device as an example. In practical applications, the highlight recommendation interface may not be displayed, meaning it is an optional interface. Figure 3 It is shown in a dashed box.
[0102] Back Figure 2 In the scenario shown, before displaying the application promotion interface, the upgrade wizard application can add the Fragments corresponding to each interface to the Fragment stack (back stack) of the FragmentManager according to a preset display order. The upgrade wizard application turns off its screen while displaying the first application promotion interface (e.g., application promotion interface 1), and then triggers an Activity restart after the screen turns on, destroying multiple Fragments in the FragmentManager.
[0103] After the Activity restarts, the upgrade wizard application can obtain the interfaces to be displayed, such as application promotion interface 2 and application promotion interface 3. Then, FragmentManager adds the Fragment of application promotion interface 2 and the Fragment of application promotion interface 3 to the Fragment stack.
[0104] When displaying application promotion screen 2, the Activity can attempt to retrieve, for example, all Fragment data from application promotion screen 2, some Fragment data from application promotion screen 1, and some Fragment data from the Entrance Page from the Fragment stack. However, since the upgrade wizard application has already displayed the Entrance Page and application promotion screen 1, the Fragment stack will not be updated with the Entrance Page Fragment and the application promotion screen 1 Fragment after the Activity restarts. This causes the upgrade wizard application to fail to display application promotion screen 2, resulting in an error.
[0105] S211. Electronic devices display a boot animation interface or desktop.
[0106] After an error occurs, the upgrade wizard app can skip the remaining app promotional screens, for example, by not displaying app promotional screen 2 and app promotional screen 3. In some scenarios, the upgrade wizard app's interface is located above the startup wizard app's interface; after exiting the upgrade wizard app, the startup wizard app can display the boot animation screen; after exiting the startup wizard app, the launcher app can display the desktop. Alternatively, after launching the upgrade wizard app, the electronic device exits the startup wizard app; after exiting the upgrade wizard app, the electronic device directly displays the desktop.
[0107] In the scenarios shown in steps S201-S211, an error occurs during the display of the application promotion interface, causing the user to only see the boot animation interface or desktop after the screen is turned on, and miss the application promotion interface.
[0108] Another scenario where electronic devices fail to display upgrade wizard information correctly is as follows: Figure 4 As shown:
[0109] Following step S204, the method further includes:
[0110] S401. When it is necessary to showcase key features, the upgrade wizard application displays a highlight recommendation interface.
[0111] For example, the upgrade wizard application displays as follows Figure 1 The highlight recommendation interface is shown in b.
[0112] S402. After a preset time, the electronic device enters a screen-off state.
[0113] exist Figure 1 In the interface shown in b, if the electronic device does not receive any user operation within a preset time, the electronic device will enter a screen-off state.
[0114] S403, After the screen is off, the upgrade wizard application triggers a config change event.
[0115] S404, The upgrade wizard application determines whether it needs to access the application's promotional interface.
[0116] This step can be referred to in the relevant description in step S205, and will not be repeated here.
[0117] The upgrade wizard application needs to continue displaying the upgrade wizard interface after the screen is turned on. Here, you can check whether the application promotion interface needs to be displayed before the screen is turned on.
[0118] S405. When the application promotion interface needs to be accessed, after the screen is turned on, the upgrade wizard application control activity is restarted in response to the configchange event.
[0119] This step can be referred to in the relevant description in step S209, and will not be repeated here.
[0120] S406. An error occurs when restarting the Activity; the upgrade wizard application does not display the application promotion interface.
[0121] See also Figure 3 The error message in this scenario could be due to, for example:
[0122] Before displaying the featured recommendations and application promotion screens, the upgrade wizard application can add the corresponding Fragments for each screen to the Fragment stack in the order they are displayed. During the featured recommendations screen display, the upgrade wizard application turns off the screen; after the screen turns back on, the Activity restarts, and the Fragments in the FragmentManager are destroyed.
[0123] When the Activity restarts, the upgrade wizard application can obtain the interfaces to be displayed, such as application promotion interface 1, application promotion interface 2, and application promotion interface 3. Then, the FragmentManager adds the Fragment of application promotion interface 1, the Fragment of application promotion interface 2, and the Fragment of application promotion interface 3 to the Fragment stack.
[0124] When displaying the application promotion screen 1, the Activity can attempt to retrieve data from the Fragment stack, such as all Fragment data for the application promotion screen 1, some Fragment data for the featured recommendation screen, and some Fragment data for the Entrance Page. However, since the upgrade wizard application has already displayed the Entrance Page and featured recommendation screen, the Fragment stack will not store the Fragments for the Entrance Page and featured recommendation screen. This causes the upgrade wizard application to fail to display the application promotion screen 1, resulting in an error.
[0125] S407, Electronic devices display a boot animation interface or desktop.
[0126] from Figure 2 and Figure 4 As shown in the scenario, even if the version upgrade process does not involve protocol changes, and the screen goes out while the upgrade wizard application is displaying any interface, the upgrade wizard application will still trigger a config change event, causing the Activity to restart after the screen comes back on. After the Activity restarts, Fragment data is lost, preventing the upgrade wizard application from continuing to render subsequent interfaces, resulting in an error. Users cannot view the application's promotional interface and thus miss the introduction of newly added service features.
[0127] It's important to note that the Activity of the startup wizard app is different from that of the upgrade wizard app. Therefore, if the version upgrade process involves a protocol change, and the screen is off while displaying the protocol change interface, the electronic device may experience Activity restarts and errors after the screen turns on. However, if the protocol change interface is skipped, the upgrade wizard app can display the featured recommendation interface and / or application promotion interface normally in the screen-on scenario, without triggering the config change event, and users will not miss the promotional information for new service features. Therefore, the above-mentioned problem scenario does not include situations where the version upgrade involves a protocol change.
[0128] However, in practice, there may be a low-probability scenario where a user performs an operation on the protocol change interface but remains inactive for an extended period on subsequent highlight recommendation or application promotion interfaces, causing the electronic device screen to turn off. This application embodiment only uses a scenario without protocol changes as an example to illustrate possible implementation problems and their causes. This application embodiment does not list all problem scenarios, but these scenarios do not limit the methods for resolving them; the upgrade wizard interface display method provided in this application embodiment can also be applied to other problem scenarios caused by the same reasons.
[0129] In view of this, this application provides a method for displaying an upgrade wizard interface. Before responding to a configchange event (e.g., before the screen is turned on), the upgrade wizard application decouples the Activity and multiple Fragments. After decoupling, the Activity and multiple Fragments no longer have dependencies. After the screen is turned on, the upgrade wizard application can respond to the configchange event and restart the Activity. However, during the Activity restart process, multiple Fragments will no longer be destroyed due to their dependencies on the Activity. Therefore, after the Activity restarts, the upgrade wizard application can obtain the Fragments of the current upgrade wizard interface, as well as the Fragments of the previous upgrade wizard interface, thereby successfully displaying the upgrade wizard interface. In this way, when the electronic device completes the upgrade and the screen is turned on again, the user can still see the promotional information of the application promotional interface involved in this version upgrade, thereby helping the user quickly understand the new service functions.
[0130] The following is combined Figure 5 The method for displaying the upgrade wizard interface provided in the embodiments of this application will be described, such as... Figure 5 As shown:
[0131] S501, Electronic device restarted and upgraded successfully.
[0132] This step can be referred to in the relevant description in step S201, and will not be repeated here.
[0133] S502. In the absence of any protocol changes, the upgrade wizard application displays the first interface.
[0134] The first screen can be a highlight recommendation screen or an application promotion screen, such as... Figure 1 The interface shown in b or Figure 1 The interface shown in 'c' is as follows. It's understandable that, assuming no changes to the agreement, if the upgrade wizard app needs to showcase key features, it can display a recommended feature interface; otherwise, it can display an application promotion interface.
[0135] The upgrade wizard application can draw the UI of the first screen based on the Activity, the Fragment data of the first screen, and some Fragments of the screens preceding the first screen.
[0136] The Activity can be created by the upgrade wizard application after it starts. After the Activity is created, it can add multiple upgrade wizard interfaces to the Fragment stack in a preset display order through the FragmentManager.
[0137] For example, Figure 6 A schematic diagram of the structure of a Fragment stack provided in an embodiment of this application is shown. For example, in Figure 6 In the upgrade wizard application, after determining the display order of multiple interfaces, the FragmentManager sequentially adds the Fragment data of Entrance Page, the Fragment data of Highlight Recommendation interface (this interface is optional and is shown with a dashed line in the figure), the Fragment data of Application Promotion Interface 1, the Fragment data of Application Promotion Interface 2, and the Fragment data of Application Promotion Interface 3 to the Fragment stack.
[0138] In this embodiment, there are dependencies between Fragments on multiple interfaces. For example, a Fragment on an interface that is later in the preset display order depends on a Fragment on an interface that is earlier in the preset display order. It is understood that the upgrade wizard interfaces shown in this embodiment are not independent interfaces; multiple upgrade wizard interfaces need to be arranged according to a preset display order. The electronic device can only display the next interface after receiving an operation in the previous interface instructing it to display the next interface. Therefore, there are dependencies between Fragments on multiple interfaces in this embodiment. For example, the display process of the first interface uses not only its own Fragment data but also some Fragment data from previous interfaces, such as the Entrance Page Fragment data from interfaces preceding the first interface.
[0139] It should be noted that this application embodiment describes the display method of the upgrade wizard interface provided in this application embodiment using the example of an electronic device directly displaying a highlight recommendation interface or an application promotion interface. In practical applications, the electronic device may have its screen locked. In this case, in step S502, the electronic device can display the lock screen interface and render the first interface. That is, the first interface is not directly displayed, but it has been rendered and is running in the background or hidden, so that the first interface can be quickly displayed after the screen is unlocked. This application embodiment does not limit this process.
[0140] Furthermore, this application embodiment describes the display method of the upgrade wizard interface provided in this application embodiment using a scenario where there is no protocol change as an example. In practical applications, electronic devices can also display a protocol change interface when... Figure 1 In the interface shown in Figure 'a', when a trigger operation is received, for example, for the next step control 101, the electronic device displays the first interface, or renders the first interface on top of the lock screen interface. Afterwards, the user may not continue interacting, causing the electronic device to enter a screen-off state. That is, this application embodiment does not limit whether there is a protocol change or whether a protocol change interface is displayed.
[0141] S503. After a preset time, the electronic device enters a screen-off state.
[0142] The process can be referred to in the relevant description in step S207, and will not be repeated here.
[0143] S504. In screen-off mode, the upgrade wizard application triggers a config change event.
[0144] This step can be referred to in the relevant description in step S208, and will not be repeated here.
[0145] S505. In screen-off mode, the upgrade wizard application detaches the Activity and multiple Fragments to remove the Fragment's dependency on the Activity.
[0146] Understandably, prior to step S505, there are dependencies between multiple Fragments and Activities. For example, the lifecycles of multiple Fragments are the same as the lifecycle of the Activity, and when the Activity is destroyed, multiple Fragments will be destroyed together.
[0147] After step S505, there is no dependency between multiple Fragments and Activities, and the lifecycle of multiple Fragments is no longer affected by the lifecycle of the Activity.
[0148] For example, an upgrade wizard application that separates Activities and multiple Fragments may include:
[0149] Obtain the FragmentManager; start a Fragment transaction; for any Fragment among multiple Fragments, call the detach() method within the Fragment transaction, passing the Fragment to the detach() method; commit the Fragment transaction to separate the multiple Fragments from the Activity. The Fragment transaction can be used to represent the process of adding, removing, replacing, attaching, and detaching Fragments.
[0150] It should be noted that after calling the detach() method, the Fragment instance and its state are preserved; for example, after calling the detach() method, the Fragment can go through lifecycle events such as onPause() and onStop(), but onDestroy() will not be called, so the Fragment instance will not be destroyed.
[0151] In addition, the UI view of the Fragment will be removed from the layout of the Activity; for example, after calling the detach() method, the lifecycle of the Fragment's UI view will go through lifecycles such as onPause(), onStop(), and onDestroyView(). After entering onDestroyView(), the UI view will be destroyed.
[0152] It is understandable that after executing step S505, the Fragment data corresponding to any upgrade wizard interface in FragmentManager includes a Fragment instance. The Fragment instance may include the Fragment state and the Fragment lifecycle, but the Fragment instance does not include the Fragment's UI view.
[0153] It should be noted that in this embodiment, step S505 can be executed after or before step S504, and this embodiment does not impose any restrictions on this. In other words, by separating the Fragment and Activity before responding to the configchange event when the screen is on, the upgrade wizard application can achieve the effect of continuing to display the application's promotional interface in scenarios where the screen is both off and on.
[0154] S506. After the screen lights up, in response to the config change event, the upgrade wizard application controls the destruction and restart of the Activity; after the Activity is destroyed, the FragmentManager retains multiple Fragments of the separated upgrade wizard interface.
[0155] In response to the config change event, the upgrade wizard application can restart the Activity after destroying it. It is understood that in this embodiment, the upgrade wizard application pre-separates the Fragments related to the upgrade wizard interface from the Activity. The lifecycle of the separated Fragments no longer depends on the lifecycle of the Activity. Therefore, after destroying the Activity, multiple Fragments remain in the Fragment stack, and the Fragments are not destroyed along with the Activity.
[0156] In other words, during this process, the Fragment stack retains, for example... Figure 6 The data shown includes Fragment data for the Entrance Page, the Featured Recommendation Page, the Application Promotion Page 1, the Application Promotion Page 2, and the Application Promotion Page 3.
[0157] It should be noted that the Fragment stack in this step is not exactly the same as the Fragment stack in step S502. For example, in the Fragment stack of step S502, each Fragment instance includes a Fragment state, a Fragment lifecycle, and a Fragment UI view; the Fragment lifecycle depends on the Activity lifecycle. In the Fragment stack of step S506, each Fragment instance includes a Fragment state and a Fragment lifecycle; and the Fragment lifecycle does not depend on the Activity lifecycle.
[0158] After S507 and Activity restart, the upgrade wizard application displays a second interface based on multiple Fragments.
[0159] The second interface is the interface following the first interface. For example, if the first interface is a featured recommendation interface, then the second interface can be application promotion interface 1; or, for another example, if the first interface is application promotion interface 1, then the second interface can be application promotion interface 2.
[0160] Upon Activity restart, the upgrade wizard app can query the interfaces to be displayed. Within the upgrade wizard interface, the electronic device will not repeat interfaces that have already been displayed, such as the first interface. The upgrade wizard app determines that the interfaces to be displayed are the second interface and subsequent upgrade wizard interfaces.
[0161] Taking the display of the second interface as an example, after the Activity restarts, the FragmentManager searches for existing Fragment instances in the Fragment stack. Since the second interface has data dependencies with the first interface and the Entrance Page, the FragmentManager can find the Fragment data for the second interface, the first interface, and the Entrance Page; the Activity can reuse this Fragment data to render the second interface. During the rendering process, the Activity can redefine the UI view layout based on the XML file and recreate the UI view by calling methods such as onCreateView(). This allows the second interface and the subsequent upgrade wizard interface to continue being displayed.
[0162] It should be noted that this embodiment of the application uses the example of an electronic device turning off its screen due to prolonged inactivity while displaying the first upgrade wizard interface to illustrate the display method of the upgrade wizard interface in this embodiment. In practical applications, users may also turn off their electronic devices after viewing multiple upgrade wizard interfaces for an extended period of time without any operation; that is, the first interface could also be application promotion interface 2, application promotion interface 3, etc. After the screen turns on, the electronic device can continue to display subsequent upgrade wizard interfaces using the above method. This embodiment of the application will not describe these in detail.
[0163] Thus, during the display of the upgrade wizard interface, even if the screen turns off and then on again, the electronic device can continue to display the upgrade wizard interface to the user. This prevents the user from missing the introduction of the newly added service functions due to the inability to draw subsequent upgrade wizard interfaces, thereby improving the user experience.
[0164] Based on the above embodiments, in order to reduce resource consumption and time delay when redrawing the interface, this application provides another method for displaying the upgrade wizard interface.
[0165] For example, electronic devices can categorize config change events into preset config change events and non-preset config change events. For instance, the upgrade wizard application's configuration file has a preset common configuration change (android:config changes) attribute. This attribute can be used to control whether an Activity restarts after a config change event is triggered. There is a one-to-one correspondence between configuration change attributes and config change events.
[0166] In this context, config change events that can be found in the configuration file for corresponding configuration change attributes are considered default config change events; config change events that cannot be found in the configuration file are considered non-default config change events. The configuration file can be, for example, the AndroidManifest.xml file.
[0167] For example, the default config change event can be a change event for the mobile country code (mcc), a change event for the mobile network code (mnc), a change event for the locale, a change event for the touchscreen availability (touchscreen), a change event for the keyboard type (keyboard), a change event for the keyboard visibility (keyboardHidden), a change event for the navigation mode (navigation), a change event for the screen layout (screenLayout), a change event for the font scaling ratio (fontScale), a change event for the user interface mode (uiMode), a change event for the screen orientation (orientation), a change event for the screen size (screenSize), a change event for the smallest screen size (smallestScreenSize), and a change event for the screen density (density), etc.
[0168] For example, non-preset config change events may include Config changes=80000000 and other undefined configuration change events.
[0169] The configuration file can include the android:config changes attribute corresponding to the above-mentioned config change event, so as to avoid the configuration change event when it is triggered, and prevent the Activity from being destroyed and restarted.
[0170] Specifically, in the screen-off state, after the upgrade wizard application triggers the config change event, the steps also include:
[0171] S601. In screen-off mode, the upgrade wizard interface searches the configuration file to see if it includes the configuration change attribute corresponding to the config change event.
[0172] If the configuration file includes the configuration change attribute corresponding to the config change event, then the config change event is a preset config change event. The upgrade wizard application can call the configuration change attribute corresponding to the config change event to avoid Activity destruction and restart, for example, in subsequent steps S602.
[0173] If the configuration change attribute corresponding to the config change event is not included in the configuration file, then the config change event is a non-preset config change event and cannot avoid Activity destruction and restart, for example, in subsequent execution step S604.
[0174] S602. If the configuration file includes the configuration change attribute corresponding to the config change event, then after the screen is turned on, the upgrade wizard application will control the Activity not to be destroyed or restarted based on the configuration change attribute.
[0175] After the screen is turned on, the upgrade wizard application can obtain the configuration change attribute corresponding to the config change event in the configuration file; the configuration change attribute can indicate to the system that in the scenario where the config change event occurs, it is desirable to manually handle the corresponding config change event instead of letting the system automatically destroy and restart the Activity; thus avoiding the config change event.
[0176] If a config change event occurs and the Activity is not destroyed, the upgrade wizard application can continue to display the upgrade wizard interface by overriding the onConfigurationChanged() method to trigger the Activity's lifecycle callbacks.
[0177] S603, the upgrade wizard application continues to display the second interface.
[0178] Understandably, if the electronic device is not destroyed and the Activity is not restarted in step S602, then multiple Fragments in the Fragment stack are retained, and the Activity can reuse the corresponding Fragments to continue drawing the second interface and subsequent interfaces.
[0179] In this way, when the `config change` event is a default event, the electronic device can avoid Activity restart by configuring the changed attributes, and the electronic device can continue to display the upgrade wizard interface so that users can understand the new service features added after the version upgrade. And compared to... Figure 5 The embodiment shown is relatively simple and can reduce the resource consumption when the interface is redrawn. It can quickly display the upgrade wizard interface after the screen is turned on, reducing time delay.
[0180] Alternatively, after step S601, the method may further include:
[0181] S604. If the configuration configuration change attribute corresponding to the config change event is not included in the configuration file, then execute steps S505-S507, for example.
[0182] In this way, the upgrade wizard application cannot avoid non-preset config change events. Therefore, before responding to non-preset config change events upon screen wake-up, the upgrade wizard application can separate the Activity and multiple Fragments to prevent multiple Fragments from being destroyed along with the Activity. See [example provided]. Figure 5 The relevant descriptions in the illustrated embodiments.
[0183] The above embodiments briefly describe the display method of the upgrade wizard interface provided in the embodiments of this application. The following describes the method for displaying the upgrade wizard interface. Figure 2 The problem scenario presented in the illustrated embodiment, combined with Figure 7 The method for displaying the upgrade wizard interface provided in the embodiments of this application will be described in general. For example... Figure 7 As shown:
[0184] S701, the electronic device restarted and the version upgrade was successful.
[0185] S702, The startup wizard application confirms that there are no protocol changes.
[0186] Step S702 is an optional step.
[0187] S703, the upgrade wizard application determines whether to display featured features.
[0188] S704. When there is no need to display highlight features, the upgrade wizard application determines whether it is necessary to access the application's promotional interface.
[0189] Steps S701-S704 can be referred to. Figure 2 The relevant descriptions in the illustrated embodiments will not be repeated here.
[0190] S705. When it is necessary to access the application's promotional interface, the upgrade wizard application displays the application promotional interface 1.
[0191] Understandably, when there is no need to showcase key features, the application promotion interface 1 can be the first upgrade wizard interface visible to the user in the upgrade wizard interface.
[0192] It should be understood that this application embodiment only illustrates the display method of the upgrade wizard interface in the scenario where the user does not operate for a long time and the screen turns off when the first upgrade wizard interface is displayed. In practical applications, electronic devices can also turn off the screen when displaying other upgrade wizard interfaces, and this application embodiment does not limit this.
[0193] S706, the upgrade wizard application monitors whether the Activity has entered the onStop lifecycle; the onStop lifecycle can be used to indicate that the electronic device has entered the screen-off state.
[0194] The Activity lifecycle can be viewed as follows: After launching the upgrade wizard application, the Activity starts; the Activity enters the onCreate() lifecycle to perform initialization work; the Activity enters the onStart() lifecycle and displays the UI; when the user performs a trigger operation on the interface, the Activity enters the onResume() lifecycle, and remains in the onResume() lifecycle during screen-on; afterwards, when the electronic device screen turns off, the Activity briefly enters the onPause() lifecycle, and then enters the onStop() lifecycle after a short time; when, for example, the Activity exits, configuration changes, or the system reclaims memory, the Activity enters the onDestroy() lifecycle.
[0195] In this embodiment, the upgrade wizard application needs to determine whether to separate the Activity and multiple Fragments before the Activity is destroyed. That is, the upgrade wizard application needs to monitor before the Activity enters the onDestroy lifecycle. Also, in a screen-on scenario, the upgrade wizard application will not trigger the config change event; therefore, the upgrade wizard application can set the monitoring time to the onPause or onStop lifecycle corresponding to the screen-off state. Furthermore, the onPause lifecycle is relatively short and difficult to monitor; and within this lifecycle, the upgrade wizard application may not be able to complete the separation process of the Activity and multiple Fragments. Therefore, in this embodiment, the monitoring time can be set to the onStop lifecycle.
[0196] In this way, electronic devices can use the `onStop` lifecycle method to determine if there is a risk of the upgrade wizard interface failing to display due to a screen-off scenario. The duration of the `onStop` lifecycle is also sufficient to allow the upgrade wizard application the time required to handle the separation of Activities and multiple Fragments. Simultaneously, the electronic device can also use the `onStop` lifecycle method to determine whether the upgrade wizard application is executing the normal process under screen-on conditions, or executing something else entirely. Figure 5 The process under screen-off conditions as shown in steps S601-S603.
[0197] S707: When the Activity enters the onStop lifecycle, the upgrade wizard application can obtain the config change event.
[0198] Understandably, when an Activity enters its onStop lifecycle, it indicates that the electronic device has entered a screen-off state. In this case, the electronic device may trigger a config change event. After the config change event is generated, the upgrade wizard application can obtain and analyze the config change event.
[0199] S708, the upgrade wizard application checks the configuration file to see if it includes the configuration change attribute corresponding to the config change event.
[0200] S709. If the configuration change attribute corresponding to the config change event is included in the configuration file, after the screen is turned on, the upgrade wizard application controls the Activity not to be destroyed or restarted based on the configuration change attribute.
[0201] S710, the upgrade wizard application continues to display the application promotion interface 2 and the upgrade wizard interface thereafter.
[0202] Steps S708-S710 can be referred to the relevant descriptions in steps S601-S603, and will not be repeated here.
[0203] S711: After the upgrade wizard interface is completed, the electronic device exits the upgrade wizard application, and the Activity and Fragment are reclaimed by the system.
[0204] The system can be used to manage memory.
[0205] It should be noted that in this embodiment, the Activity and Fragment are separated, so when the Activity is destroyed, the Fragment will not be destroyed along with it. Regarding the issue of recycling the Activity and the separated Fragment, in this embodiment, the electronic device can instruct the system to recycle the Activity and the separated Fragment when exiting the upgrade wizard application, eliminating the need for an additional recycling process.
[0206] For example, after the screen lights up, the electronic device can sequentially display the upgrade wizard interfaces until the last upgrade wizard interface is displayed. When a trigger operation, such as proceeding to the next step, is received in the last upgrade wizard interface, the electronic device determines that the upgrade wizard interface display is complete, exits the upgrade wizard application, and the Activity is destroyed. Simultaneously, the system can destroy all resources in the Fragment stack of the FragmentManager.
[0207] S712, electronic devices display a boot animation interface or desktop.
[0208] This step can be referred to in the relevant description in step S211, and will not be repeated here.
[0209] Alternatively, after step S708, the method may further include:
[0210] S713. If the configuration change attribute corresponding to the config change event is not included in the configuration file, the upgrade wizard application separates the Activity and multiple Fragments to remove the dependency of Fragments on the Activity.
[0211] S714. After the screen is turned on, in response to the config change event, the upgrade wizard application controls the destruction and restart of the Activity; after the Activity is destroyed, the FragmentManager retains multiple Fragments of the upgrade wizard interface.
[0212] Steps S713-S714 can be referred to the relevant descriptions in steps S505 and S506, and will not be repeated here.
[0213] After the Activity restarts, the upgrade wizard application continues to execute steps S710-S712, for example. Step S710 can be referred to the relevant description in step S507, and will not be repeated here.
[0214] Thus, in such Figure 2In the scenario shown where the upgrade wizard interface is displayed and the screen is off, electronic devices can handle the config change event by configuring change attributes or separating the Activity and Fragment. This reduces the problem of the electronic device not displaying the upgrade wizard interface after the screen is off and then on again, thereby improving the user experience.
[0215] Alternatively, after step S706, the method may further include:
[0216] S715. If no Activity is detected entering the onStop lifecycle, the upgrade wizard application can execute steps S710-S712.
[0217] If the Activity has not entered the onStop lifecycle state, it indicates that the electronic device is in a screen-on state. When the screen is on, the upgrade wizard application will not trigger the config change event. Therefore, the upgrade wizard application can continue to display the upgrade wizard interface using the normal process.
[0218] In this way, when the screen is on, the electronic device can use the standard process to display the upgrade wizard interface to the user, informing the user of the new service functions added after the version upgrade.
[0219] Alternatively, after step S704, the method may further include:
[0220] S716. If the application promotion interface does not need to be accessed, the upgrade wizard application can execute step S712.
[0221] Understandably, in some scenarios, version upgrades involve minor changes that may not affect the application's promotional interface, allowing electronic devices to directly access the boot animation or desktop.
[0222] The following is about Figure 4 The problem scenario presented in the illustrated embodiment, combined with Figure 8 The method for displaying the upgrade wizard interface provided in the embodiments of this application will be described in general. For example... Figure 8 As shown:
[0223] S801, The electronic device has restarted and successfully upgraded.
[0224] S802, The startup wizard application confirms that there are no protocol changes.
[0225] Step S802 is an optional step.
[0226] S803, the upgrade wizard application determines whether to display featured features.
[0227] Steps S801-S803 can be referred to. Figure 2The relevant descriptions in the illustrated embodiments will not be repeated here.
[0228] S804. When it is necessary to showcase key features, the upgrade wizard application can display a highlight recommendation interface.
[0229] Understandably, when it is necessary to showcase key features, the featured feature recommendation screen can be the first upgrade wizard screen visible to the user in the upgrade wizard interface.
[0230] S805, the upgrade wizard application monitors whether the Activity enters the onStop lifecycle; the onStop lifecycle can be used to indicate that the electronic device enters the screen-off state.
[0231] This step can be referred to in the relevant description in step S706, and will not be repeated here.
[0232] S806. When the Activity enters the onStop lifecycle, the upgrade wizard application determines whether it needs to access the application's promotional interface.
[0233] Understandably, when the screen is off, the upgrade wizard application can determine whether the application promotional interface needs to be displayed. If the application promotional interface needs to be displayed, the electronic device can execute the method shown in the embodiments of this application to continue displaying the application promotional interface after the screen is turned on. If the application promotional interface does not need to be displayed, the electronic device does not need to continue displaying the application promotional interface after the screen is turned on, and therefore does not need to execute the process of avoiding Activity restart or the process of saving Fragments when restarting the Activity in the embodiments of this application.
[0234] S807. When the application promotion interface needs to be accessed, the upgrade wizard application can obtain the config change event.
[0235] This step can be referred to in the relevant description in step S707, and will not be repeated here.
[0236] S808, the upgrade wizard application checks the configuration file to see if it includes the configuration change attribute corresponding to the config change event.
[0237] S809. If the configuration change attribute corresponding to the config change event is included in the configuration file, after the screen is turned on, the upgrade wizard application controls the Activity not to be destroyed or restarted based on the configuration change attribute.
[0238] S810, the upgrade wizard application continues to display the application promotion interface 1 and the subsequent upgrade wizard interface.
[0239] Steps S807, S809 and S810 can be referred to the relevant descriptions in steps S601-S603, and step S808 can be referred to the relevant descriptions in step S404, which will not be repeated here.
[0240] S811. After the upgrade wizard interface is completed, the electronic device exits the upgrade wizard application, and the Activity and Fragment are recycled by the system.
[0241] The process can be referred to in the relevant description in step S711, and will not be repeated here.
[0242] S812, Electronic devices display a boot animation interface or desktop.
[0243] This step can be referred to in the relevant description in step S211, and will not be repeated here.
[0244] Alternatively, after step S807, the method may include:
[0245] S813. If the configuration change attribute corresponding to the config change event is not included in the configuration file, the upgrade wizard application separates the Activity and multiple Fragments to remove the dependency of Fragments on the Activity.
[0246] S814. After the screen is turned on, in response to the config change event, the upgrade wizard application controls the destruction and restart of the Activity; after the Activity is destroyed, the FragmentManager retains multiple Fragments of the upgrade wizard interface.
[0247] Steps S813-S814 can be referred to the relevant descriptions in steps S505 and S506, and will not be repeated here.
[0248] After the Activity restarts, the upgrade wizard application continues to execute steps S810-S812, for example. Step S810 can be referred to the relevant description in step S507, and will not be repeated here.
[0249] Thus, in such Figure 4 In the scenario shown where the upgrade wizard interface is displayed and the screen is off, electronic devices can handle the config change event by configuring change attributes or separating the Activity and Fragment. This reduces the problem of the electronic device not displaying the upgrade wizard interface after the screen is off and then on again, thereby improving the user experience.
[0250] To better understand the embodiments of this application, the structure of the electronic device of the embodiments of this application is described below:
[0251] Figure 9 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a subscriber identification module (SIM) card interface 195, and an embedded secure element (eSE) chip 196, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0252] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0253] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0254] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0255] The electronic device 100 implements its display function through a GPU, a display screen 194, and an application processor. The display screen 194 is used to display images, videos, etc. For example, the display screen 194 can be used to display images as shown in the embodiments of this application. Figure 1 The interface in the middle.
[0256] Touch sensor 180K, also known as a "touch device". Touch sensor 180K can be set on display screen 194, and touch screen 180K and display screen 194 together form a touch screen, also known as a "touch screen". In this embodiment, electronic device 100 can recognize user operation through touch sensor 180K and display screen 194 to switch upgrade wizard interface.
[0257] In this embodiment, the electronic device can light up its screen based on a trigger operation on button 190; the electronic device can also light up its screen when camera 193 captures the user's face; the electronic device can also light up its screen based on the gyroscope sensor 180B and / or accelerometer sensor 180E detecting that the user has picked up the electronic device; and so on. This embodiment will not elaborate on these specific details.
[0258] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc. This application embodiment uses a layered architecture Android system as an example; exemplarily, the following describes... Figure 10 Explain the software structure of electronic device 100.
[0259] In this embodiment of the application, the software of the electronic device is divided into five layers, from top to bottom: application layer, framework layer (or application framework layer), system library and Android runtime, HAL layer (hardware abstraction layer), and driver layer (or kernel layer).
[0260] The application layer can include a series of applications, such as Figure 10 As shown, the application layer can include applications such as camera, calendar, map, phone, and music.
[0261] In this embodiment, after an electronic device undergoes a version upgrade, the application layer may further include a startup wizard application and an upgrade wizard application to promptly display the newly added service functions to the user. In some embodiments, the startup wizard application and the upgrade wizard application may be system applications that do not display application icons on the desktop.
[0262] Startup wizard applications can guide users through the initial setup of their devices, such as language selection, network settings, and password settings. After a system upgrade of an electronic device, the startup wizard application can also display a protocol change interface based on whether there are any protocol changes before and after the system upgrade.
[0263] The upgrade wizard application can be used to display the upgrade wizard interface to inform users of the new service features added in the new version.
[0264] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes predefined functions. For example, it may include a window manager, content provider, view system, resource manager, and notification manager, etc., but this embodiment does not impose any limitations on these.
[0265] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0266] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.
[0267] Content providers can also provide a standard interface for applications, enabling different applications to access each other's data. By using a content provider, an application can fully encapsulate its own data and access it through a unified interface, allowing other applications to access that application's data through the content provider. For example, in this embodiment, the upgrade wizard application can obtain relevant data from the application's promotional interface through the application's interface provided by the content provider.
[0268] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0269] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0270] The notification manager allows applications to display notification information in the status bar, which can be used to convey informational messages.
[0271] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing library (OpenGL ES), 2D graphics engine (SGL), etc.
[0272] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0273] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0274] OpenGL ES is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0275] SGL is a 2D graphics engine.
[0276] The Android runtime consists of the core libraries and the ART virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java code needs to call, and the other part consists of the Android core libraries. The application layer and application framework layer run in the ART virtual machine. The ART virtual machine executes the Java files in the application layer and application framework layer as binary files.
[0277] The Hardware Abstraction Layer (HAL) is the interface layer between the operating system kernel and the hardware circuitry, and its purpose is to abstract the hardware. The HAL contains multiple library modules, such as audio modules, Bluetooth modules, camera modules, and sensor modules.
[0278] The kernel layer is the layer between hardware and software. The kernel layer may contain, for example, display drivers, camera drivers, audio drivers, sensor drivers, etc.
[0279] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0280] The following is combined Figure 11 This application provides a flowchart illustrating the method for displaying an upgrade wizard interface. Figure 11 This is a flowchart illustrating a method for displaying an upgrade wizard interface, as provided in an embodiment of this application.
[0281] like Figure 11 As shown, the method for displaying the upgrade wizard interface can be applied to electronic devices, including the upgrade wizard application. This method may include the following steps:
[0282] S1101. When an electronic device is upgraded from version 1 to version 2, the upgrade wizard application is enabled on the electronic device.
[0283] The first version can be the old version in the electronic device, and the second version can be the new version obtained by the electronic device from the OTA server; the second version is used to update or upgrade the operating system of the electronic device.
[0284] Understandably, the electronic device can be restarted after downloading the second version package, and then configured based on that second version package. Once configuration is complete, the electronic device can launch the upgrade wizard application to display the upgrade wizard interface.
[0285] S1102, The upgrade wizard application creates the first Activity; the first Activity corresponds to multiple Fragments; the lifecycle of the multiple Fragments depends on the lifecycle of the Activity, and any Fragment in the multiple Fragments corresponds to an upgrade wizard interface; the upgrade wizard interface is used to guide users to understand the new service features added in the second version compared to the first version.
[0286] The upgrade wizard interface may include a highlight recommendation interface and multiple application promotion interfaces; the multiple application promotion interfaces may be, for example, application promotion interface 1, application promotion interface 2, and application promotion interface 3, etc.
[0287] After launching the upgrade wizard application, it can create Activities, such as the first Activity. The upgrade wizard application can also add multiple Fragments to the Fragment stack via FragmentManager. Each Fragment corresponds to an upgrade wizard interface, for example... Figure 6 As shown.
[0288] The lifecycle of multiple Fragments depends on the lifecycle of the Activity. That is, after the first Activity is destroyed, all Fragments corresponding to the first Activity are destroyed together.
[0289] S1103, The upgrade wizard application renders the first interface based on the first Activity and the first Fragment; the upgrade wizard interface includes the first interface; the first Fragment corresponds to the first interface.
[0290] The first screen can be a highlight recommendation screen, such as... Figure 1 The interface shown in b; it can also be an application promotional interface, such as Figure 1 The interface shown in c is an example of the interface in this application embodiment. The first interface can be the interface directly displayed on the screen of the electronic device; alternatively, the first interface can be a rendered interface located below the lock screen interface after the lock screen function is enabled, which can be quickly displayed on the screen after unlocking.
[0291] The first interface can be, for example... Figure 7 and Figure 8 In the illustrated embodiment, the first upgrade wizard interface visible to the user among multiple upgrade wizard interfaces (e.g., the highlight recommendation interface or application promotion interface 1) can also be a subsequent upgrade wizard interface visible to the user (e.g., application promotion interface 1 and subsequent upgrade wizard interfaces or application promotion interface 2 and subsequent upgrade wizard interfaces). This application embodiment does not limit the scenarios in which the upgrade wizard interface may not be displayed after the screen is turned off and then on again.
[0292] It should be noted that other Fragments may also be involved when rendering the first interface, such as the Entrance Page Fragment, which are not listed one by one in the embodiments of this application.
[0293] S1104. If no user operation is received within a preset time, the electronic device enters the screen-off state.
[0294] The process can be referred to in the relevant description in step S503, and will not be repeated here.
[0295] S1105, The upgrade wizard application triggers a configuration change event; the configuration change event is used to indicate that the system configuration of the electronic device has changed.
[0296] The configuration change event corresponds to the config change event. Refer to the relevant description in step S504 for the procedure.
[0297] S1106, The upgrade wizard application separates the first Activity and multiple Fragments; the lifecycle of the separated multiple Fragments no longer depends on the lifecycle of the first Activity.
[0298] The process can be referred to in the relevant description in step S505, and will not be repeated here.
[0299] S1107. In response to the screen-on operation, the electronic device enters the screen-on state.
[0300] S1108. In response to a configuration change event, the upgrade wizard application destroys the first Activity and creates a second Activity after restarting; wherein the second Activity is different from the first Activity; after destroying the first Activity, the upgrade wizard application retains multiple detached Fragments.
[0301] It is understandable that the Activity before and after destruction may not be the same Activity. Here, the first Activity represents the Activity before destruction, and the second Activity represents the Activity after restarting.
[0302] The process can be referred to in the relevant description in step S506, and will not be repeated here.
[0303] S1109. The upgrade wizard application displays a second interface based on the second Activity, the separated first Fragment, and the separated second Fragment; the second Fragment corresponds to the second interface, which is the interface in the upgrade wizard interface that is preset to be displayed after the first interface.
[0304] The second interface can be an interface displayed after the first interface. For example, the first interface is a highlight recommendation interface, and the second interface can be an application promotion interface 1; the first interface is an application promotion interface 1, and the second interface is an application promotion interface 2, etc.
[0305] After the Activity restarts, the upgrade wizard application can use the newly created second Activity, as well as the detached Fragments retained in the FragmentManager, to display the second interface.
[0306] It is understood that in this embodiment, there are data dependencies between the Fragments of multiple upgrade wizard interfaces, so the display process of the second interface will involve some Fragment data from the first interface. It should be noted that this embodiment only uses the example of the second interface display process requiring the use of the first and second Fragments to illustrate the dependencies between multiple upgrade wizard interfaces. In practical applications, when displaying the second interface, it may also involve Fragments from other upgrade wizard interfaces that are preset to be displayed before the second interface, such as the Entrance Page Fragment. This embodiment does not impose any limitations on this.
[0307] In this way, even if the screen turns off and then on again during the upgrade wizard process, the electronic device can continue to display the upgrade wizard interface to the user. This prevents the user from missing the introduction of the new service functions due to the inability to draw subsequent upgrade wizard interfaces, thereby improving the user experience.
[0308] Optionally, the upgrade wizard application may separate the first Activity and multiple Fragments, including: the upgrade wizard application calling the detach() method to separate the first Activity from any of the multiple Fragments; the separated Fragment has its own lifecycle, and the lifecycle of the separated Fragment is different from that of the first Activity.
[0309] The process can be referred to in the relevant description in step S505, and will not be repeated here.
[0310] In this way, electronic devices can decouple the Activity from multiple Fragments, so that when the Activity is destroyed and restarted, the Fragment will not be destroyed along with the Activity, thus avoiding the problem of not being able to find the Fragment when the screen is on to display the subsequent upgrade wizard interface.
[0311] Optionally, the electronic device includes a configuration file containing attribute information for a preset configuration change event. This attribute information is used to prevent the Activity from being destroyed and restarted when the preset configuration change event is triggered. After the electronic device enters a screen-off state, the device also includes: an upgrade wizard application checking whether the configuration file contains the attribute information for the configuration change event; and the upgrade wizard application separating the first Activity and multiple Fragments, including separating the first Activity and multiple Fragments if the configuration file does not contain the attribute information for the configuration change event.
[0312] Configuration files can be, for example, the AndroidManifest.xml file, and attribute information can be, for example, android:configchanges. It's understandable that when the configuration change event is set to the default configuration change event, the electronic device can quickly avoid Activity restarts through the attribute information, thus reducing the scenario where the upgrade wizard interface doesn't display after the screen is turned on. When the configuration change event is not set to a default configuration change event, the electronic device cannot avoid Activity restarts, so the electronic device can address the scenario where the upgrade wizard interface doesn't display after the screen is turned on by addressing the Activity restart scenario.
[0313] In this way, electronic devices can determine whether configuration change events can be avoided. If not, they can implement a solution that separates Activities and multiple Fragments, reducing the problem of the upgrade wizard interface not being displayed after the screen is turned on.
[0314] Optionally, after the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file, it also includes: in response to the screen-on operation, the electronic device enters the screen-on state; if the configuration change event attribute information is included in the configuration file, the upgrade wizard application does not process the configuration change event based on the configuration change event attribute information; the upgrade wizard application displays the second interface according to the first Activity, the first Fragment, and the second Fragment.
[0315] Understandably, electronic devices can control the Activity to prevent it from being destroyed or restarted through attribute information; the Activity used to display the second interface is still the first Activity.
[0316] In this way, when the config change event is a default event, the electronic device can avoid Activity restart through attribute information, and can continue to display the upgrade wizard interface so that users can understand the new service features added after the version upgrade. This method is also relatively simple, reduces resource consumption during interface redrawing, and allows for quick display of the upgrade wizard interface after the screen lights up, minimizing time delays.
[0317] Optionally, before the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file, the following steps are also included: the upgrade wizard application detects whether the first Activity has entered the OnStop lifecycle; the OnStop lifecycle is used to reflect that the electronic device has entered the screen-off state; the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file, including: when the first Activity is detected to have entered the OnStop lifecycle, the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file.
[0318] In this way, electronic devices can use the `onStop` lifecycle method to determine whether there is a risk of the upgrade wizard interface failing to display due to a screen-off scenario. The duration of the `onStop` lifecycle method is also sufficient to allow the upgrade wizard application to handle the separation process of Activity and multiple Fragments. Simultaneously, the electronic device can also use the `onStop` lifecycle method to determine whether the upgrade wizard application is executing the normal process under screen-on conditions or the process of displaying the upgrade wizard interface under screen-off conditions.
[0319] Optionally, the first interface is also used to indicate whether to display the second interface; the display process of the second interface depends on the second Fragment and the first Fragment of the first interface. In this embodiment, multiple upgrade wizard interfaces can be displayed sequentially according to a preset display order, and the previous interface will affect the display of the next interface, so there will be data dependencies between multiple Fragments.
[0320] Optional features include: upon exiting the upgrade wizard application, the system reclaims the second Activity and multiple detached Fragments; the system uses this to manage memory.
[0321] In this way, if the lifecycle of the separated Fragment is not destroyed along with the Activity, the electronic device can automatically reclaim the separated Fragment when exiting the upgrade wizard application, without consuming additional power to process the separated Fragment.
[0322] Optionally, the electronic device also includes a boot wizard application; before the electronic device opens the upgrade wizard application, it further includes: the boot wizard application determining whether there is a protocol change in the second version; the protocol change is used to instruct the boot wizard application to display an interface related to the protocol change; the electronic device opening the upgrade wizard application includes: if there is no protocol change in the second version, the boot wizard application launches the upgrade wizard application; after the electronic device opens the upgrade wizard application, it further includes: the upgrade wizard application determining whether a highlight recommendation interface needs to be displayed, the upgrade wizard interface including a highlight recommendation interface; the highlight recommendation interface is used to display multiple newly added service functions in the same interface; the upgrade wizard interface also includes multiple application promotion interfaces; any application promotion interface is used to display the newly added service function corresponding to an application; in the preset display order in the upgrade wizard interface, any application promotion interface is located after the highlight recommendation interface; the upgrade wizard application renders the first interface based on the first Activity and the first Fragment, including: if the upgrade wizard application needs not to display the highlight recommendation interface, the upgrade wizard application renders the application promotion interface based on the first Activity and the first Fragment.
[0323] This process can be referenced. Figure 7 The relevant descriptions in the illustrated embodiments will not be repeated here.
[0324] In this way, without needing to display the protocol change interface and the highlight recommendation interface, when the electronic device's screen turns off and then on again, the device can handle the config change event by changing configuration attributes or separating the Activity and Fragment. This reduces the problem of the electronic device not displaying subsequent application promotion interfaces, thereby improving the user experience.
[0325] Optionally, the upgrade wizard application renders the first interface based on the first Activity and the first Fragment, and further includes: when the upgrade wizard application needs to display a highlight recommendation interface, the upgrade wizard application renders the highlight recommendation interface based on the first Activity and the first Fragment.
[0326] In this way, when it is not necessary to display the protocol change interface but it is necessary to display the highlight recommendation interface, after the electronic device screen turns off and on again, the electronic device can handle the configuration change event by changing the configuration attribute or separating the Activity and Fragment. This reduces the problem of the electronic device not displaying the application promotion interface, thereby improving the user experience.
[0327] The method for displaying the upgrade wizard interface according to the embodiments of this application has been described above. The apparatus for executing the above method provided in the embodiments of this application will now be described. Those skilled in the art will understand that the methods and apparatus can be combined and referenced together, and the related apparatus provided in the embodiments of this application can execute the steps in the method for displaying the upgrade wizard interface described above.
[0328] like Figure 12 As shown, the device 1200 can be used in a device, circuit, hardware component, or chip. The device includes a display unit 1201 and a processing unit 1202. The display unit 1201 is used to support the display steps performed by the device 1200; the processing unit 1202 is used to support the information processing steps performed by the device 1200.
[0329] In a possible implementation, the device 1200 may also include a communication unit 1203. Specifically, the communication unit is used to support the device 1200 in performing the steps of sending and receiving data. The communication unit 1203 may be an input or output interface, pins, or circuits, etc.
[0330] In a possible embodiment, the device may further include a storage unit 1204. The processing unit 1202 and the storage unit 1204 are connected via a line. The storage unit 1204 may include one or more memories, which may be devices in one or more devices or circuits used for storing programs or data. The storage unit 1204 may exist independently and be connected to the processing unit 1202 of the device via a communication line. Alternatively, the storage unit 1204 may be integrated with the processing unit 1202.
[0331] Storage unit 1204 can store programs or instructions for methods in the device, so that processing unit 1202 can execute the methods in the above embodiments. Storage unit 1204 can be a register, cache, or RAM, etc., and storage unit 1204 can be integrated with processing unit 1202. Storage unit 1204 can be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and storage unit 1204 can be independent of processing unit 1202.
[0332] The upgrade wizard interface display method provided in this application embodiment can be applied to electronic devices with communication functions. Electronic devices include electronic devices in general; the specific device form of an electronic device can be referred to the above-mentioned descriptions, and will not be repeated here.
[0333] This application provides an electronic device, which includes a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the electronic device to perform the above-described method.
[0334] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0335] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0336] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0337] This application provides a computer program product, which includes a computer program that, when run, causes the computer to perform the above-described method.
[0338] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0339] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A method for displaying an upgrade wizard interface, characterized in that, Applied to an electronic device, the electronic device including an upgrade wizard application, the method includes: When the electronic device is upgraded from version 1 to version 2, the electronic device opens the upgrade wizard application; The upgrade wizard application creates a first activity; the first activity corresponds to multiple fragments; the lifecycle of the multiple fragments depends on the lifecycle of the first activity, and any one of the multiple fragments corresponds to one upgrade wizard interface; the upgrade wizard interface is used to guide users to understand the new service features added in the second version compared to the first version; The upgrade wizard application renders a first interface based on the first Activity and the first Fragment; the upgrade wizard interface includes the first interface; the first Fragment corresponds to the first interface; If no user operation is received within a preset time, the electronic device enters a screen-off state. The upgrade wizard application triggers a configuration change event; the configuration change event is used to indicate that the system configuration of the electronic device has changed. The upgrade wizard application separates the first Activity and the multiple Fragments; the lifecycle of the multiple separated Fragments no longer depends on the lifecycle of the first Activity; In response to a screen-on operation, the electronic device enters a screen-on state; In response to the configuration change event, the upgrade wizard application destroys the first Activity and creates a second Activity upon restart; wherein the second Activity is different from the first Activity; after destroying the first Activity, the upgrade wizard application retains multiple detached Fragments; The upgrade wizard application displays a second interface based on the second Activity, the separated first Fragment, and the separated second Fragment; the second Fragment corresponds to the second interface, which is the interface in the upgrade wizard interface that is preset to be displayed after the first interface.
2. The method according to claim 1, characterized in that, The upgrade wizard application separates the first Activity and the multiple Fragments, including: The upgrade wizard application calls the detach() method to separate the first Activity from any of the plurality of Fragments; the separated Fragment has its own lifecycle, and the lifecycle of the separated Fragment is different from that of the first Activity.
3. The method according to claim 1 or 2, characterized in that, The electronic device includes a configuration file containing attribute information for a preset configuration change event; the attribute information is used to prevent the Activity from being destroyed and restarted when the preset configuration change event is triggered. After the electronic device enters the screen-off state, it also includes: The upgrade wizard application checks whether the configuration file includes attribute information for the configuration change event; The upgrade wizard application separates the first Activity and the multiple Fragments, including: If the configuration change event attribute information is not included in the configuration file, the upgrade wizard application separates the first Activity and the multiple Fragments.
4. The method according to claim 3, characterized in that, After the upgrade wizard application checks whether the configuration change event's attribute information is included in the configuration file, it also includes: In response to the screen-on operation, the electronic device enters the screen-on state; If the configuration change event is included in the configuration file, the upgrade wizard application will not process the configuration change event based on the configuration change event's attribute information. The upgrade wizard application displays a second interface based on the first Activity, the first Fragment, and the second Fragment.
5. The method according to claim 3 or 4, characterized in that, Before the upgrade wizard application searches whether the configuration change event's attribute information is included in the configuration file, it also includes: The upgrade wizard application detects whether the first Activity has entered the OnStop lifecycle; the OnStop lifecycle is used to reflect that the electronic device has entered the screen-off state. The upgrade wizard application checks whether the configuration file includes attribute information for the configuration change event, including: Upon detecting that the first Activity has entered the OnStop lifecycle, the upgrade wizard application checks whether the configuration change event attribute information is included in the configuration file.
6. The method according to any one of claims 1-5, characterized in that, The first interface is also used to indicate whether the second interface is displayed; the display process of the second interface depends on the second Fragment and the first Fragment of the first interface.
7. The method according to any one of claims 1-3, characterized in that, Also includes: Upon exiting the upgrade wizard application, the system reclaims the second Activity and the multiple detached Fragments; The system is used to manage memory.
8. The method according to any one of claims 1-7, characterized in that, The electronic device also includes a startup wizard application; before the electronic device starts the upgrade wizard application, it also includes: The boot wizard application determines whether there is a protocol change in the second version; the protocol change is used to instruct the boot wizard application to display an interface related to the protocol change; The electronic device opens the upgrade wizard application, including: If there are no protocol changes in the second version, the startup wizard application will launch the upgrade wizard application; After the electronic device opens the upgrade wizard application, it also includes: The upgrade wizard application determines whether to display a highlight recommendation interface. The upgrade wizard interface includes the highlight recommendation interface. The highlight recommendation interface is used to display multiple newly added service functions on the same interface. The upgrade wizard interface also includes multiple application promotion interfaces. Each application promotion interface is used to display a newly added service function corresponding to an application. In the preset display order of the upgrade wizard interface, each application promotion interface is located after the highlight recommendation interface. The upgrade wizard application renders a first interface based on the first Activity and the first Fragment, including: If the upgrade wizard application does not need to display the highlight recommendation interface, the upgrade wizard application renders the application promotion interface based on the first Activity and the first Fragment.
9. The method according to claim 8, characterized in that, The upgrade wizard application renders the first interface based on the first Activity and the first Fragment, and also includes: When the upgrade wizard application needs to display a highlight recommendation interface, the upgrade wizard application renders the highlight recommendation interface based on the first Activity and the first Fragment.
10. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1-9.
11. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-9.
12. A chip system, characterized in that, It includes at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a line, the at least one processor being configured to run a computer program or instructions to perform the method as described in any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to perform the method as described in any one of claims 1-9.