Application multi-window display method and electronic device
By running the system-created activity within the process of a third-party application, the problem of high system memory usage in multi-window display mode is solved, enabling simultaneous management of two display windows and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2023-09-25
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, the multi-window display mode of applications leads to excessive system memory consumption, making it impossible to manage two display windows simultaneously and affecting user experience.
Running system-created activities within the process of third-party applications ensures that system-created components start within the application's process by storing the application's process name and unique identifier in the activity object, thus avoiding the consumption of system memory.
It enables simultaneous management of two display windows while avoiding excessive system memory usage, thus improving the user experience.
Smart Images

Figure CN119690551B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and more specifically, to a method for displaying multiple windows of an application and an electronic device. Background Technology
[0002] With the continuous development of smart terminals, devices such as smartphones, tablets, and in-vehicle displays are becoming increasingly popular, bringing great convenience to people's lives, studies, and work. As electronic device screen technology develops, users' demands for the multi-tasking and multi-window processing capabilities of smart terminals are also increasing.
[0003] To facilitate user operation and browsing of electronic devices with displays, related technologies support in-application split-screen display technology, also known as parallel view mode. This parallel view mode enables dual-window display of application content, allowing two pages of the application to be displayed on two separate windows, such as the application homepage and content page, or two different content pages, so that users can use two screens at once and improve the user experience.
[0004] However, the activities corresponding to the two display windows run in the application's process and the system's process, respectively, which consumes system memory and makes it impossible to manage the two display windows simultaneously, thus reducing the user experience. Summary of the Invention
[0005] This application provides a method for displaying multiple windows of an application and an electronic device. This method can run a system-created activity in the process of a third-party application, thereby ensuring simultaneous management of two display windows while avoiding the occupation of system memory, thus improving the user experience.
[0006] In a first aspect, this application provides a method for displaying multiple windows of an application. The method provided in the first aspect can be executed by an electronic device, or by a module applied in an electronic device (such as a processor, chip, or chip system), or by a logical node, logical module, or software that can implement all or part of the functions of the electronic device. This application does not limit the scope of the method.
[0007] Specifically, the method includes: an electronic device receiving a first operation from a user, the first operation being used to open an application that supports a parallel view mode, the parallel view mode including a first window and a second window, the first window corresponding to a component launched by the application, and the second window corresponding to a component created by the system of the electronic device; in response to the first operation, the electronic device creating an activity and launching the system-created component, the activity object including the application's process name and unique identifier; and launching the system-created component in the application's process according to the application's process name and unique identifier in the activity object.
[0008] The method provided in the first aspect, based on the user's first operation, after opening the application's parallel view mode, creates a corresponding activity object for the newly added components of the system. This activity object includes the application's process name and unique identifier. Therefore, based on the application's process name and unique identifier in the activity object, the newly added components of the system are started in the application's process, ensuring that the components corresponding to the first window and the second window are started in the same application process. This ensures that the two display windows can be managed simultaneously without occupying system memory, thus improving the user experience.
[0009] In one possible implementation of the first aspect, before the electronic device creates an active object, the method further includes: the electronic device's system determining the application's process name and unique identifier based on a first operation. In this implementation, the electronic device's system parses the application's process name and unique identifier based on the user's operation of opening the application, so that system-created components are launched into the application's process based on the process name and unique identifier.
[0010] In one possible implementation of the first aspect, the application's process name and unique identifier are stored in the first field of the intent. In this implementation, the intent describes the component to be started and carries some necessary data for the component to be started; therefore, storing the application's process name and unique identifier in the first field of the intent allows the component to be started into the corresponding process.
[0011] In one possible implementation of the first aspect, the electronic device creates an activity object by: creating an empty activity object, reading the process name and unique identifier from the first field of the intent, and storing the process name and unique identifier in the empty activity object to obtain the activity object. In this implementation, in order for the system-created component to be launched into the corresponding application, the application's process name and unique identifier need to be stored in the empty activity object so that when the activity object is run in the task stack, the system-created activity is launched into the corresponding application.
[0012] In one possible implementation of the first aspect, the first field is an extra field.
[0013] In one possible implementation of the first aspect, starting a system-created component within the application's process based on the application's process name and unique identifier in the active object includes: starting the system-created component in the currently running process when the application's process name and unique identifier in the active object match the process name and unique identifier of the currently running process; and starting the system-created component in the new process when the application's process name and unique identifier in the active object do not match the process names and unique identifiers of any currently running processes. In this implementation, the process name and unique identifier of the application in the active object determine whether the system-created component runs in an existing process or in a newly created process. It should be understood that both the existing process and the newly created process are processes within the application.
[0014] In one possible implementation of the first aspect, the system-created components are stored in a system jar package that is loaded when the application starts.
[0015] In this implementation, when the system-created component runs in the application process and the application loads the window that needs to be displayed, the implementation of the component or other functional logic on the component is still on the system side. Therefore, when the system-created component is stored in the system's JAR package that will be loaded when the application starts, the application can load these JAR packages when it starts, thus ensuring that the window corresponding to the system-created activity can be displayed normally.
[0016] For example, the system's JAR file can be any one of framework.jar, hwEmui.jar, and services.jar. Of course, the system's JAR file that will be loaded when the application starts can also be other JAR files. This application embodiment does not make any specific limitations here.
[0017] In one possible implementation of the first aspect, in response to the first operation, the display states of the display components of the first window and the second window are consistent. In this implementation, in response to the first operation, an activity created by the system is launched in the application's process, and the first window and the second window correspond to the same process, which allows the display states of the draggable components of the first window and the second window to be consistent.
[0018] In one possible implementation of the first aspect, both the drgbar of the first window and the drgbar of the second window are highlighted, the draggable component of the first window includes the drgbar of the first window, and the draggable component of the second window includes the drgbar of the second window. In this implementation, highlighting the drgbars of both the first and second windows provides the user with a consistent user experience.
[0019] In one possible implementation of the first aspect, the second window is displayed on the screen of the electronic device in a full-screen or floating window manner.
[0020] In one possible implementation of the first aspect, the validation of the package name and unique identifier of system-created components is skipped when the application starts. In this implementation, since the system-created components only modify the process name and unique identifier, and the package name of the component remains the system package name, skipping the validation of the package name and unique identifier of system-created components can ensure that the window corresponding to the system-created component is successfully displayed when the application starts.
[0021] In one possible implementation of the first aspect, the operating system of the electronic device is the Android operating system.
[0022] In a second aspect, a communication device is provided, which includes units for performing the steps of the first aspect or any possible implementation of the first aspect.
[0023] Thirdly, a communication device is provided, comprising at least one processor and a memory coupled together, the memory storing program instructions that, when executed by the processor, perform the method of the first aspect or any possible implementation thereof.
[0024] Fourthly, a communication device is provided, comprising at least one processor and interface circuitry, the at least one processor being configured to perform the methods described in the first aspect or any possible implementation thereof.
[0025] Fifthly, an electronic device is provided, comprising a processor and a memory, the memory for storing a computer program, and the processor for calling and running the computer program from the memory, causing the electronic device to perform the methods of the first aspect or any possible implementation thereof.
[0026] In one possible implementation of the fifth aspect, the electronic device can be any one of a mobile phone, tablet, personal computer, or vehicle infotainment system.
[0027] In one possible implementation of the fifth aspect, the operating system of the electronic device is the Android operating system.
[0028] In a sixth aspect, a computer program product is provided, comprising a computer program that, when executed by a processor, performs the method of the first aspect or any possible implementation thereof.
[0029] In a seventh aspect, a computer-readable storage medium is provided, wherein a computer program is stored therein, which, when executed, performs the method of the first aspect or any possible implementation thereof.
[0030] Eighthly, a chip is provided, comprising: a processor for calling and running a computer program from a memory, causing a communication device on which the chip is installed to perform a method for performing the first aspect or any possible implementation of the first aspect. Attached Figure Description
[0031] Figure 1 A schematic diagram of a parallel view display mode is shown.
[0032] Figure 2 This diagram illustrates another example of a parallel view display mode.
[0033] Figure 3 This shows a schematic diagram of the interface when an application is launched for the first time;
[0034] Figure 4 This diagram illustrates the logic for finding the launch process of an activity in the Android operating system.
[0035] Figure 5 A schematic diagram of the structure of the electronic device 100 provided in this application is shown;
[0036] Figure 6 A software structure block diagram of an electronic device 100 according to an embodiment of this application is shown;
[0037] Figure 7 This illustration shows a schematic diagram of an example of a multi-window application interface provided in an embodiment of this application.
[0038] Figure 8 A schematic flowchart illustrating an example of multi-window display of an application provided in an embodiment of this application is shown;
[0039] Figure 9 A schematic flowchart illustrating another example of multi-window display of an application provided in this application embodiment is shown;
[0040] Figure 10 A schematic flowchart illustrating yet another example of multi-window display of an application provided in this application embodiment is shown;
[0041] Figure 11 A schematic flowchart of an application multi-window display method 1100 provided in an embodiment of this application is shown;
[0042] Figure 12 A schematic diagram of the structure of an electronic device provided in this application is shown. Detailed Implementation
[0043] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0044] The terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the embodiments of this application, “one or more” means one or more (including two); “and / or” describes the relationship between related objects, indicating that three relationships may 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.
[0045] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0046] The "multiple" mentioned in the embodiments of this application refers to two or more. It should be noted that in the description of the embodiments of this application, terms such as "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance, nor should they be construed as indicating or implying order.
[0047] With the continuous development of smart terminals, devices such as mobile phones, tablets, PCs, and in-vehicle displays are widely used in scenarios such as home entertainment, office work, and learning. Consumers' demand for the multi-tasking and multi-window processing capabilities of smart terminal devices is also gradually increasing. To improve the user experience of multi-tasking parallel processing, the floating window of the terminal device can now support free resizing. When the user drags the floating window to the landscape window size, it can be displayed in a parallel view mode within the floating window.
[0048] Parallel View mode, based on an application's activity (a component), extends the display framework, enabling independent display of each activity and allowing it to appear in different positions on the screen. Parallel View mode can be understood as an in-app split-screen function; in landscape mode, different interface information from an application can be displayed simultaneously in two windows, fully utilizing the large screen of a tablet. Corresponding to different user needs, Parallel View mode can be divided into navigation bar mode, shopping mode, and custom mode. Navigation bar mode means the main application interface is always displayed on the left, while the right window displays newly clicked content; applications using this mode are generally instant messaging applications. Shopping mode allows users to compare products, always displaying the two most recent windows: the right one is the newest, and the left one is the second newest; applications using this mode are generally shopping applications. Custom mode allows developers to customize the window display mode, enabling full-screen or split-screen displays based on business scenarios. Developers only need to integrate the UIKit development framework and configure it to support applications such as video playback.
[0049] It should be understood that Parallel View mode is different from the traditional split-screen function. Split-screen simply displays an additional interface, while Parallel View displays an application interface in split-screen mode.
[0050] For example, Figure 1 A schematic diagram of a parallel view display mode is shown, as follows: Figure 1 As shown, a floating window 105 of a certain application is displayed on the display screen 102 of the tablet computer 101. The floating window 105 displays two windows, namely window 103 and window 104. That is, the content displayed in window 103 and the content displayed in window 104 come from the same application, and the display interface of the same application can be displayed simultaneously in the left and right windows in parallel view mode.
[0051] For example, Figure 2 This diagram illustrates another example of a parallel view display mode. Figure 2As shown, a floating window 205 of another application is displayed on the screen 202 of the tablet computer 201. The floating window 205 displays two windows, Window 203 and Window 204. This floating window 205 can be understood as an application task stack, where Window 203 corresponds to an application activity, and Window 204 corresponds to an activity. The floating window 205 also includes a title bar 206, which is formed by combining the title bars of Window 203 and Window 204. The title bar 206 includes zoom in and zoom out buttons on the left and a close button on the right. A drag button 207 is displayed in the middle of the application task stack; clicking and dragging the floating window allows you to move its position.
[0052] based on Figure 1 and Figure 2 The interface shown illustrates that displaying multiple windows in parallel view mode within a floating window requires at least two activities. However, when an application is first launched, there is usually only one activity, which cannot enter parallel view mode immediately. A second activity needs to be launched to access parallel view. Therefore, from the user's perspective, it's unclear under what circumstances clicking on content within the application will enter parallel view mode. Consequently, the system on the electronic device could supplement applications that support parallel view with an empty activity. When the user launches the application for the first time, the system launches the empty activity, and with two activities, the application can directly enter the floating window parallel view state.
[0053] For example, Figure 3 This shows a schematic diagram of the interface when an application is launched for the first time. Figure 3 As shown in Figure (a), a floating window 305 of an application is displayed on the screen 302 of the tablet computer 301. This floating window 305 can freely change its size. When the application supports parallel view mode, the user can drag the floating window 305 to change its size. When the floating window 305 is sized to landscape mode, it enters parallel view mode. After entering parallel view mode, as shown... Figure 3 As shown in Figure (b), the floating window 305 displays two windows, namely window 303 and window 304.
[0054] As we can see, when an application is launched for the first time, it typically only has one activity, and the user is unaware whether changing the size of the floating window will allow them to enter the parallel view. Therefore, the system side of the electronic device can add an empty activity to the application. When the user launches the application for the first time, the system side launches the empty activity simultaneously. That is, when the user launches the application for the first time, such as... Figure 3As shown in Figure (b), the system launches an empty activity to remind the user that the application supports parallel view mode.
[0055] Therefore, in order for an electronic device to display multiple windows in a parallel view mode within a floating window, in addition to the activity launched when the application is first launched, the system side of the electronic device also needs to launch another empty activity to support the application's floating window parallel view state.
[0056] The following section uses the Android operating system as an example to explain the process of launching an activity.
[0057] Normally, all components within the same application run in the same process. However, if you want to control which specific component belongs to a particular process, you can configure this in the manifest file. Each component element in the manifest file (e.g., activity) supports an "android:process" attribute. This attribute specifies the process in which a component runs. In other words, by setting this attribute, you can allow each component to run in its own process, allow some components to share a process, or allow components from different applications to run in the same process.
[0058] It should be understood that each application corresponds to a manifest file, which describes the basic information and functions of an application, such as the application's name, icon, version number, components, and permissions. The manifest file also includes information to ensure the application's compatibility, security, and stability with other applications and system components.
[0059] It should also be understood that `android:process` is generally used to start multiple processes for an application, that is, to assign a running process name to the components under the application. Each component defines its own process name by setting its own `process` attribute. By default, Android creates one process for an application. When the first component of the application runs, all components run in the same process, and the name of this process can be the same as the `backage` (package name) in the manifest file.
[0060] All activities in an application need to be declared in the application's manifest.xml file, which includes the `<activity>` tag and the `<application>` tag. Therefore, this declaration can specify the activity's launch process either by configuring `android:process` under the `<activity>` tag or by configuring `android:process` within the `<application>` tag.
[0061] For example, Figure 4 This diagram illustrates the logic for locating the launch process of an activity in the Android operating system. Figure 4 As shown, the system first checks if the `process` attribute is configured in the `<activity>` tag. If it is, `processName` will be the name configured in the `<activity>` tag. If not, it checks the `<application>` tag. If it is, `processName` will be the name configured in the `<application>` tag. If neither is configured, `processName` will be the application's package name.
[0062] Once the processname is determined, it and a unique identifier (UID) are used to search the list of existing processes for a match. If a match is found, the activity is launched in that process, thus reducing resource usage. If no match is found, a new process is created. The UID is assigned by the system and is typically the UID of the application containing the activity.
[0063] Similarly, in parallel view mode, when the system creates an empty activity, its launch process is as described above. That is, the empty activity can only be declared in the system manifest file. Without specifying the `process` attribute, the activity will run in the corresponding system process, not the application's process. If the empty activity's process runs in the system process, it will cause two problems: First, it consumes system memory, affecting performance and power consumption; second, the floating window dual-window corresponds to two activities, one from the application running in the application's process, and the other from the system running in the system's process. Since the application's activity and the system's activity are not in the same process, cross-process activity communication becomes difficult, making it impossible to ensure simultaneous management of the lifecycles of the two display windows. Therefore, when the user operates on one side of the screen, the content on the other side can easily be affected. Ultimately, this prevents many synchronization functions from being implemented.
[0064] For example, see continue. Figure 2 ,like Figure 2 As shown, if the activity corresponding to window 203 and the activity corresponding to window 204 are not in the same process, then when the user clicks the title bar of the left window, the drag bar of the right window cannot be highlighted, and the drag bars of the left and right windows cannot be in focus or out of focus at the same time. This will cause confusion for the user regarding the two focus states in the same application, thus affecting the user experience.
[0065] In summary, because the `android:process` field in the `<activity>` and `<application>` tags is a static field, it cannot dynamically adapt to all third-party applications. Therefore, the process of the system-added activity cannot run in the corresponding application. The current problem to be solved is how to modify the launch process of the system-added activity so that it can adapt to any third-party application.
[0066] In view of this, this application provides a method for displaying multiple windows of an application. The method includes: creating an activity object based on a system activity launch request; simultaneously determining the processName and uid of the third-party application that needs to be modified on the system side of the electronic device; saving the processName and uid of the third-party application to the created activity object; and determining whether there is a running process based on the saved processName and uid. If so, the system activity is launched into that process; otherwise, a new process is created. This method allows multiple windows of an application to run within the application's process, thereby ensuring the electronic device can simultaneously manage multiple display windows while avoiding the occupation of system memory.
[0067] Before introducing the application multi-window display method provided in this application, the electronic device provided in this application will be described in detail first. This application provides an electronic device for executing the application multi-window display method provided in this application. For example, the electronic device in this application embodiment can be a personal computer, various portable laptops, various tablet computers, mobile phones, in-vehicle systems, etc. Optionally, the electronic device can also be a personal digital assistant (PDA), a handheld device with a large display screen, a computing device, an in-vehicle device, a wearable device, an electronic device in a 5G network, or an electronic device in an evolved public land mobile network (PLMN), etc., and this application embodiment is not limited to these.
[0068] Among the electronic devices mentioned above, the electronic device can be a single screen, a foldable screen, or a curved screen, etc. A foldable screen can have a structure with two physical screens or a structure with only one physical screen; no specific limitation is made here. For an electronic device with two physical screens, it can include a main screen and a secondary screen. The main screen can serve as the left window of the electronic device, and the secondary screen can serve as the right window. In the embodiments of this application, the multi-window display method for applications provided in this application can also be applied to electronic devices with three or more screens; no specific limitation is made here.
[0069] For example, Figure 5The diagram shown is a schematic representation of the structure of an electronic device 100 provided in this application. The 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, and a subscriber identification module (SIM) card interface 195, 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.
[0070] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0071] In this embodiment, the processor 110 can receive a user's instruction to open an application. For example, after the user performs the application launch operation, the display screen can achieve split-screen display, that is, display the first window and the second window in landscape mode on the display screen. Furthermore, based on the user's operation, the processor 110 runs the system-created activity in the process of the third-party application, thereby ensuring that the two display windows can be managed simultaneously, improving the user experience.
[0072] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0073] 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 directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0074] The memory is used to store the application code that executes the solution of this application, and the processor 110 controls the execution of the application code stored in the memory to control the electronic device 100 to implement the application multi-window display method provided in the embodiment of this application.
[0075] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0076] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0077] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0078] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0079] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0080] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0081] In the embodiments of this application, the display screen 194 can be used to display a floating window, which includes multiple windows, namely the window corresponding to the activity launched by the application and the window corresponding to the activity created by the system.
[0082] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0083] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0084] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0085] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0086] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0087] For example, in this embodiment, the user's action of opening an application can be obtained through the touch sensor 180K. After receiving the user's action of opening the application, the processor 110, in response to the action, launches a system-created activity in the process of the third-party application.
[0088] Buttons 190 include a power button, volume buttons, etc. Motor 191 can generate vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, and also to indicate messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. 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 can be implemented in hardware, software, or a combination of software and hardware.
[0089] Figure 6 This diagram illustrates the software architecture of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0090] like Figure 6 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0091] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 6 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, layout manager, and activity manager, etc.
[0092] 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.
[0093] Content providers are used to store and retrieve data, and make that data accessible to applications.
[0094] 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.
[0095] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0096] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0097] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0098] A layout manager is used to arrange a view consisting of individual components in sequence according to layout requirements to form a display interface.
[0099] The Activity Manager is used to manage the lifecycle of individual applications and navigation back functionality. It is responsible for creating the Android main thread and maintaining the lifecycle of each application.
[0100] For example, in this embodiment, the Activity Manager is used to launch a system-created activity, create an ActivityRecord (activity object) according to the requested parameters, and save the processname (process name) and uid (unique identifier) parsed by the system to the ActivityRecord; then, it initializes the launch parameters; the Activity Manager is also used to search for the corresponding launch stack in the Activity Stack Manager based on the processname and uid. Then, the Activity Stack Manager in the Activity Manager searches the list of currently existing processes for a match based on the processname and uid saved in the ActivityRecord. If a match is found, the system-created activity is launched into that process; otherwise, a new process is created based on the processname and uid, and then the system-created activity is launched into the new process.
[0101] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0102] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0103] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0104] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0105] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0106] 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.
[0107] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0108] A 2D graphics engine is a graphics engine for 2D drawing.
[0109] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0110] The following example, using a parallel view scenario, illustrates the workflow of the software and hardware of electronic device 100.
[0111] When the touch sensor 180K receives a touch operation, the corresponding hardware trigger is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a single-finger touch click operation as an example, if the touch operation is determined to be an application that opens the parallel view mode based on the user's touch operation, the split-screen application calls the interface of the application framework layer to start the split-screen application, and then calls the kernel layer to start the display driver. The display driver then realizes the presentation of the parallel view mode, that is, the split-screen display of the screen.
[0112] 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.
[0113] For ease of understanding, the following embodiments of this application will be described using the following methods: Figure 5 and Figure 6 Taking the electronic device with the structure shown as an example, and in conjunction with the accompanying drawings and application scenarios, the method for displaying multiple windows of an application provided in this application embodiment will be specifically described.
[0114] Before introducing the multi-window display method for applications provided in this application, we will first explain the applicable application scenarios of this method.
[0115] For example, Figure 7 This illustration shows a schematic diagram of an example of a multi-window application interface provided in an embodiment of this application. Figure 7 As shown in Figure (a), multiple applications are displayed on the screen 702 of the tablet computer 701. When the user clicks on the Chat app 703, the Chat app 703 responds to the user's open operation by launching the application's activity, while the electronic device's system launches an empty activity. The tablet computer's display interface consists of... Figure 7 The interface shown in (a) switches to Figure 7 The interface shown in (b) is as follows: Figure 7 As shown in interface (b), a floating window 704 corresponding to the Changcha application 703 is displayed on screen 702. This floating window 704 includes a display window 705 and a display window 706. Display window 705 corresponds to the activity launched by the Changcha application and displays the main interface of the Changcha application. Display window 706 corresponds to the activity launched by the system and displays the application icon of the Changcha application, indicating that the Changcha application supports parallel view mode. When the user... Figure 7 When clicking on the dialog box with Xiao Wang in the interface shown in Figure (b), the tablet's display interface changes. Figure 7 The interface shown in (b) switches to Figure 7 The interface shown in (c) is as follows: Figure 7 As shown in Figure (c), the left display window 705 always maintains the main application interface, while the right display window 706 displays the new content clicked on the left; that is, the right display window switches from display window 706 to display window 708. From Figure 7 Figure (b) in the middle and Figure 7Figure (c) also shows that after entering the floating window parallel view, the dragbar control 707 above the display interface is highlighted on both sides, indicating that the display window 705 and the display window 706 are in the same process, or that the display window 705 and the display window 708 are in the same process and are in focus at the same time, giving the user a unified experience and thus improving the user experience.
[0116] It should be understood that the systems of the electronic devices mentioned in the embodiments of this application may include, but are not limited to, HarmonyOS and Symbian. apple blackberries Operating systems, for example, can initiate activity creation-related functions through interfaces created by the electronic device's system. For instance, an activity can be created through these interfaces, and the activity's processname and uid can be determined through the same interfaces. These system-created interfaces could be parallel horizon service interfaces.
[0117] It should be noted that, Figure 7 The example provided uses the navigation bar mode in parallel view mode as an illustration, but it does not constitute a limitation on the application scenarios of the multi-window display method for applications provided in this application. The multi-window display method for applications provided in this application is also applicable to other modes of parallel view mode, such as shopping mode and custom mode, etc., which will not be illustrated here.
[0118] It should also be noted that in the above examples, the display method of the electronic device is a split-screen display in landscape mode. In other embodiments of this application, it can also be a split-screen display in portrait mode. This application does not specifically limit the display state of the electronic device.
[0119] The following is combined Figure 8 For Figure 7 The following section provides a detailed explanation of how display windows 705 and 706 reside in the same application process in the scenario shown.
[0120] Figure 8 A schematic flowchart illustrating an example of multi-window display of an application provided in this application embodiment is shown, such as... Figure 8As shown, when a user clicks the application icon, the electronic device responds to the application launch operation by sending a launch request to the activitystarter (the activity launcher class). Upon receiving the launch request, the activitystarter creates a corresponding activityrecord based on the request parameters. It should be understood that one activityrecord corresponds to one activity, and each activityrecord stores all the activity's information. This activity manager can also be called an activity management service.
[0121] It should be understood that ActivityStarter is a new class added to the Android operating system, primarily responsible for launching activities. Specifically, ActivityStarter handles activity launch requests, including parsing Intents, selecting the appropriate activity, and handling permissions; it processes various parameters during activity launch, such as flags, options, and launchBounds; it manages the activity's launch state, such as waiting to launch, launching, and launched; and it listens for changes in the activity's launch state, such as successful launch, launch failure, and cancellation. In short, the purpose of ActivityStarter is to make the activity launch process more flexible, controllable, and extensible.
[0122] The electronic device's system side parses the application configuration to determine the processname and uid of the supplementary system activity. For example, in... Figure 7 In the example shown, the processName and uid of the activity provided by the system can be the processName and uid of the Changliao app. The activitystarter stores the determined processName and uid in the activityrecord. Then, the activitystarter searches for the corresponding launch stack in the activity stack manager. The activity stack manager searches multiple process lists for a matching processName and uid. If a match is found, the activity is launched into that process; otherwise, a new process is launched. For example, if the list of running processes in the activity stack manager includes the processName and uid of the Changliao app, the activity is launched directly into that process. If not, a new process is created based on the processName and uid, and then the system-created activity is launched into the newly created process.
[0123] It should be understood that the Activity Stack Manager is used to manage task stacks, and a task stack consists of one or more ActivityRecords. Therefore, the Activity Stack Manager includes multiple running task stacks. To reduce resource usage, when launching an Activity process, the ActivityStarter can first check the Activity Stack Manager for a matching running process. If a matching process is found, the Activity process is launched into that process; otherwise, a new process is launched.
[0124] In some embodiments, Figure 9 A schematic flowchart illustrating another example of multi-window display of an application provided in this application embodiment is shown, such as... Figure 9 As shown, the system side of the electronic device launches a supplementary activity through the Parallel Vision service interface. After determining the processname and uid, the application's processname and uid can be stored in the extra field of the Intent. When the system side of the electronic device reaches the activitystarter to create an activity record after a series of calls, it reads the value stored in the extra field of the Intent, and then saves the read processname and uid to the newly created activity record in the activity management service. The activity management service uses the new processname and uid when selecting the launch process. The client (the application's client) launches the activity by calling handleLaunchActivity, and wakes the activity by calling performLaunchActivity. By skipping the verification of the activity's package name and uid, the display window corresponding to the activity can be successfully displayed.
[0125] For example, such as Figure 7 As shown, once the system determines that the processname and uid are the processname and uid of the Changliao application, it saves the processname and uid of the Changliao application in the extra field of the Intent. When the activitystarter creates the activityrecord, it reads the processname and uid of the Changliao application saved in the extra field of the Intent. Then, the activity management service starts the process based on the processname and uid of the Changliao application when selecting the startup process.
[0126] It should be understood that the system side of an electronic device passes an Intent to the ActivityStarter, which then launches a new activity instance upon receiving the Intent. This Intent describes the activity to be launched and carries the necessary data.
[0127] It should be noted that when the system-supplemented activity runs on a third-party application, the third-party application's display interface needs to load the corresponding interface of the activity. However, the implementation code of various components in this activity is all on the system side. Therefore, in this embodiment, the system-supplemented activity must be placed in a system JAR file that is loaded when the application starts; otherwise, the activity will not be found, resulting in a "classNotFound" error, ultimately causing the corresponding interface of the activity to fail to display correctly. The system JAR file that the application loads at startup can be framework.jar, hwEmui.jar, etc.
[0128] For example, in Figure 7 In the example shown, when the system-supplemented activity runs in the Changliao application, the Changliao application needs to load the corresponding interface of the activity (i.e., the interface shown in display window 708). However, the functional implementation code of each component in display window 708 is all on the system side. The Changliao application loads the system's JAR files when it starts up. Therefore, the system-supplemented activity can be placed in the system JAR files that the Changliao application loads when it starts up, and can successfully call the functional implementation code on the system side to run on the Changliao application side.
[0129] It should also be noted that, based on Figure 8 and Figure 9 The flowchart shown illustrates how, to allow the system-added activity to run within the application process, its processname and uid are changed to the application's processname and uid. However, the package name of the system-added activity remains the system package name, which may cause exceptions during application verification. To address this issue, a special verification method can be added to the application's client. This method either satisfies security checks for the system-added activity or skips the verification of its package name and uid while still satisfying security checks.
[0130] Figure 10 This illustration shows another example of a multi-window display of an application provided in this application, such as... Figure 10As shown, when a user clicks the application, the Activity Management Service (ATMS) launches the activity as the user. ATMS sends a `getActivitystartController` instruction to the activity launcher class. The activitystarter executes the request according to the instruction and creates an activity object. Then, the activitystarter executes the internal launch activity and initializes the launch parameters. The activitystarter saves the processname and uid parsed by the system to the created activity object. The activitystarter sends a `startActivityLocked` instruction to the Task and a `ResumeFocusedTasksTopActivities` instruction to the RootWindowContainer. The RootWindowContainer sends a `resumeTopActivityInnerLocked` instruction to the Task. After the Task sends a `startSpecificActivity` instruction to the activity stack manager, the activity stack manager obtains the process controller and locks the launched service based on the application's processname and uid.
[0131] The following will combine Figure 7 The scene diagram illustrates the method for displaying multiple windows of an application provided in the embodiments of this application. Figure 11 A schematic flowchart of an application multi-window display method 1100 provided in an embodiment of this application is shown. Figure 11 As shown, Figure 11 The method 1100 shown may include steps S1110 to S1130. The following is in conjunction with... Figure 11 Detail each step in method 1100.
[0132] It should be understood that in this embodiment of the application, the method 1100 is described using an electronic device as the execution subject. As an example and not a limitation, the execution subject of the method 1100 can also be a chip applied in an electronic device.
[0133] S1110: Receive the user's first operation, which is used to open the application. The application supports parallel view mode. Parallel view mode includes a first window and a second window. The first window corresponds to the activity launched by the application, and the second window corresponds to the activity created by the system of the electronic device.
[0134] It should be noted that the application involved in the embodiments of this application refers to application software; the application can be a system application or a third-party application running on the terminal; for example, the first application can be the system's built-in application software, or it can be an application software (social application, shopping application, etc.) downloaded and installed by the user, and this application does not limit it.
[0135] It should also be noted that the applications involved in this application can be World Wide Web (Web) applications or native applications. Web applications refer to web-based applications that run in a browser. Native applications refer to applications that can run directly on the current operating system. Web applications include, but are not limited to, ticketing applications, message boards, and forums running in a browser; native applications include, but are not limited to, music applications, shopping applications, graphics editing applications, and sports applications.
[0136] In step S1110, the user's first operation can be the operation of opening the application, and the application supports parallel view mode.
[0137] For example, you can refer to Figure 7 The electronic device receives the user's first operation, which is the user opening the Changcha application. This Changcha application supports parallel view mode; therefore, when the user launches the Changcha application for the first time, the application includes a first window (display window 705) and a second window (display window 706). Display window 705 corresponds to the activity launched by the Changcha application, and display window 706 corresponds to an activity created by the system. In this embodiment, it is desired to launch the activity corresponding to display window 706 into the Changcha application's launch process.
[0138] S1120, In response to the first operation, the electronic device creates an activity object and launches an activity created by the system. The activity object includes the application's processname and uid.
[0139] In this embodiment, since the activity corresponding to the second window is created by the system, when the system-created activity is started, the activity record corresponding to the activity is created. In order for the system-created activity to run in the corresponding application, the activity object includes the application's processname and uid.
[0140] For example, such as Figure 7As shown in Figure (b), after responding to the first operation, the electronic device creates an activity record, which is used to launch the system-created activity (the activity corresponding to display window 706). In order for the activity corresponding to display window 706 to be launched into the process of the Changliao application, the created activity record should include the processname and uid of the Changliao application.
[0141] S1130. Launch the system-created activity in the application's process based on the application's processname and uid in the activity object.
[0142] In step S1030, since the activity object includes the application's processname and uid, the activity stack management server can start the system-created activity in the application's process based on the processname and uid during the activity startup process.
[0143] For example, such as Figure 7 As shown in Figure (b), the activity record used to launch the system-created activity includes the process name and uid of the Changliao application. Therefore, the activity corresponding to the display window 706 can be launched into the Changliao application.
[0144] The multi-window display method for applications provided in this application, based on the user's first operation, opens the application's parallel view mode and creates a corresponding activity object for the newly added activity in the system. This activity object includes the application's processname and uid. Therefore, based on the application's processname and uid in the activity object, the newly added activity in the system is launched in the application's process, ensuring that the activities corresponding to the first and second windows are launched in the same process, thereby ensuring that the two display windows can be managed simultaneously and improving the user experience.
[0145] In some possible implementations, before the electronic device creates an activity object, the method further includes: the electronic device's system determining the application's processname and uid based on a first operation. In this implementation, the electronic device's system parses the application's processname and uid based on the user's action of opening the application, so that the system-created activity is launched into the application's process based on the processname and uid.
[0146] In some possible implementations, the application's processname and uid are stored in the first field of the intent. In this implementation, the intent describes the activity to be launched and carries some necessary data for the launched activity; therefore, storing the application's process name and unique identifier in the first field of the intent allows the component to be launched into the appropriate process. For example, this first field could be an extra field.
[0147] In some possible implementations, the electronic device creates an activity object, including: the electronic device creates an empty activity object, reads the processname and uid from the first field of the intent, and stores the processname and uid in the empty activity object to obtain the activity object.
[0148] In this implementation, in order for the system-created activity to be launched into the corresponding application, the application's processname and uid need to be saved into an empty activity object so that when the activity object is run in the task stack, the system-created activity will be launched into the corresponding application.
[0149] In some possible implementations, the system-created activity is launched in the application's process based on the application's processname and uid in the activity object. This includes: when the application's processname and uid in the activity object match the processname and uid of the currently running process, the system-created activity is launched in the currently running process; when the application's processname and uid in the activity object do not match the processname and uid of any of the currently running processes, a new process is created based on the application's processname and uid in the activity object, and the system-created activity is launched in the new process.
[0150] In this implementation, the system can determine whether the activity created by the system runs in an existing process or a newly created process based on the application's processname and uid in the activity object. It should be understood that both the existing process and the newly created process are processes within the application.
[0151] In some possible implementations, system-created activities are stored in system JAR files that are loaded when the application starts. In this approach, when the application loads the window that needs to be displayed after the system-created activity is running in the application process, the implementation of components on that window or other functional logic on the activity remains on the system side. Therefore, when the system-created activity is stored in system JAR files that are loaded when the application starts, the application can load these JAR files at startup, thus ensuring that the window corresponding to the system-created activity can be displayed correctly.
[0152] For example, the system's JAR file can be any one of framework.jar, hwEmui.jar, and services.jar. Of course, the system's JAR file that will be loaded when the application starts can also be other JAR files. This application embodiment does not make any specific limitations here.
[0153] For example, such as Figure 7 As shown in Figure (c), when the display window 708 runs in the Changliao application process, the Changliao application needs to load the components corresponding to the display window 708. However, the implementation of the components on the window or other functional logic on the display window 708 is still on the system side. Therefore, when the activity created by the system is saved in the system's jar package that will be loaded when the Changliao application starts, the Changliao application can load these jar packages when it starts, thus ensuring that the display window 708 can be displayed normally.
[0154] In some possible implementations, in response to the first operation, the display state of the draggable components of the first window and the second window is consistent. In this implementation, in response to the first operation, the system-created activity is launched in the application's process, and the first window and the second window correspond to the same process, which allows the display state of the draggable components of the first window and the second window to be consistent.
[0155] For example, the draggable components of the first window and the second window are both drgbar, and their display status is the same, which can be understood as both being highlighted or both being grayed out.
[0156] For example, relative to Figure 1 , Figure 2 as well as Figure 3 Figure (b) in the middle, Figure 7 Figure (b) in the middle and Figure 7 The drag components 707 shown in Figure (c) have a consistent display state (i.e., all are highlighted), which improves the user experience.
[0157] In some possible implementations, the second window is displayed on the screen of the electronic device in a full-screen or floating manner.
[0158] For example, such as Figure 7 Figure (b) in the middle or Figure 7 As shown in Figure (c), display window 706 and display window 708 can be displayed on the display screen 702 of tablet computer 701 in full-screen or floating window mode.
[0159] In some possible implementations, the validation of the package name and unique identifier of system-created components is skipped when the application starts. In this implementation, since the system-created components only modify the process name and unique identifier, and the package name of the component is still the system package name, skipping the validation of the package name and unique identifier of system-created components can ensure that the window corresponding to the system-created component is successfully displayed when the application starts.
[0160] In some possible implementations, the operating system of the electronic device is the Android operating system.
[0161] The foregoing has detailed examples of the multi-window display method for applications provided in this application. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0162] This application can divide the drag-and-drop method for cross-system target objects into functional units based on the above method example. For example, each function can be divided into its own functional unit, or two or more functions can be integrated into one unit. The integrated unit can be implemented in hardware or software. It should be noted that the unit division in this application is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0163] Figure 12 A schematic diagram of the structure of an electronic device provided in this application is shown. Figure 12The dashed lines indicate that the unit or module is optional. Electronic device 1200 can be used to implement the methods described in the above method embodiments. Electronic device 1200 can be a terminal device or a server, or a module (e.g., a processor, chip, or chip system) applied in a terminal device or server, or a logical node, logical module, or software capable of implementing all or part of the terminal functions, or a logical node, logical module, or software capable of implementing all or part of the server functions.
[0164] Electronic device 1200 includes one or more processors 1201, which enable electronic device 1200 to implement Figure 11 The method described in the corresponding method embodiment. Processor 1201 can be a general-purpose processor or a dedicated processor. For example, processor 1201 can be a central processing unit (CPU). The CPU can be used to control the electronic device 1200, execute software programs, and process data from the software programs. The electronic device 1200 may also include a communication unit 1205 for implementing signal input (reception) and output (transmission).
[0165] The aforementioned electronic device 1200 may be a chip (system) including a memory and a processor, wherein the processor is configured to execute a computer program stored in the memory to implement the methods shown in the various embodiments above.
[0166] The communication unit 1205 may be an input and / or output circuit of the chip (system), or the communication unit 1205 may be a communication interface of the chip (system), and the chip (system) may be a component of the electronic device 1200.
[0167] For example, communication unit 1205 may be a transceiver of electronic device 1200, or communication unit 1105 may be a transceiver circuit of electronic device 1200.
[0168] The electronic device 1200 may include one or more memories 1202 storing a program 1204. The program 1204 can be executed by a processor 1201 to generate instructions 1203, causing the processor 1201 to execute the method described in the above method embodiments according to the instructions 1203. Optionally, the memory 1202 may also store data. Optionally, the processor 1201 may also read data stored in the memory 1202, which may be stored at the same memory address as the program 1204, or it may be stored at a different memory address than the program 1204.
[0169] The processor 1201 and memory 1202 can be configured separately or integrated together, for example, integrated on a system-on-chip (SOC) of an electronic device.
[0170] For details on how the processor 1201 executes the multi-window display method of the application, please refer to the relevant description in the method embodiment.
[0171] It should be understood that the steps of the above method embodiments can be implemented by hardware logic circuits or software instructions in the processor 1201. The processor 1201 may be a CPU, a digital signal processor (DSP), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gate, transistor logic devices, or discrete hardware components.
[0172] This application also provides a computer program product that, when executed by processor 1201, implements the method of any method embodiment of this application.
[0173] The computer program product can be stored in memory 1202, for example, program 1204. Program 1204 is finally converted into an executable object file that can be executed by processor 1201 after processing such as preprocessing, compilation, assembly and linking.
[0174] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the method of any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.
[0175] The computer-readable storage medium is, for example, memory 1202. Memory 1202 can be volatile memory or non-volatile memory, or memory 1202 can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), SynchLink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
[0176] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and technical effects of the above-described apparatus and equipment can be referred to the corresponding processes and technical effects in the foregoing method embodiments, and will not be repeated here.
[0177] The systems, apparatuses, and methods disclosed in the embodiments provided in this application can be implemented in other ways. For example, some features of the method embodiments described above may be omitted or not performed. The apparatus embodiments described above are merely illustrative; the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Multiple units or components may be combined or integrated into another system. Furthermore, the coupling between units or components can be direct or indirect, including electrical, mechanical, or other forms of connection.
[0178] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
[0179] Finally, the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for displaying multiple windows of an application program, characterized by, The method is applied to an electronic device, and the method includes: The system receives a first operation from the user, which is used to open an application. The application supports a parallel view mode, which includes a first window and a second window. The first window corresponds to a component launched by the application, and the second window corresponds to a component created by the system of the electronic device. Based on the first operation, the process name and unique identifier of the application are determined; In response to the first operation, the electronic device creates an activity object corresponding to the component created by the system and starts the component created by the system. The activity object includes the process name and unique identifier of the application. The system-created components are started in the application's process based on the application's process name and unique identifier in the active object.
2. The method of claim 1, wherein, The application's process name and unique identifier are stored in the first field of the intent.
3. The method of claim 2, wherein, The electronic device creates active objects, including: The electronic device creates an empty activity object, reads the process name and unique identifier from the first field, and saves the process name and unique identifier in the empty activity object to obtain the activity object.
4. The method of claim 3, wherein, The first field includes the extra field.
5. The method according to any one of claims 1-4, characterized in that, The step of starting the system-created component in the process of the application based on the process name and unique identifier of the application in the activity object includes: When the process name and unique identifier of the application in the active object match the process name and unique identifier of the currently running process, the system-created component is started in the currently running process. When the process name and unique identifier of the application in the active object do not match the process name and unique identifier of the currently running process, a new process is created based on the process name and unique identifier of the application in the active object, and the components created by the system are started in the new process.
6. The method according to any one of claims 1-4, characterized in that, The activity created by the system is stored in the system's JAR file, which is loaded when the application starts.
7. The method according to any one of claims 1-4, characterized in that, In response to the first operation, the display states of the drag components of the first window and the drag components of the second window are consistent.
8. The method according to any one of claims 1-4, characterized in that, Both the drgbar of the first window and the drgbar of the second window are highlighted. The drag component of the first window includes the drgbar of the first window, and the drag component of the second window includes the drgbar of the second window.
9. The method according to any one of claims 1-4, characterized in that, The second window is displayed on the screen of the electronic device in full-screen or floating window mode.
10. The method according to any one of claims 1-4, characterized in that, When the application starts, the verification of the package name and unique identifier of the components created by the system is skipped.
11. The method according to any one of claims 1-4, characterized in that, The operating system of the electronic device is Android.
12. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store a computer program; the processor being used to execute the method as described in any one of claims 1-11 when the computer program is invoked.
13. The electronic device according to claim 12, characterized in that, The electronic device can be any one of a mobile phone, tablet, personal computer, or vehicle infotainment system.
14. The electronic device according to claim 13, characterized in that, The operating system of the electronic device is Android.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-11.
16. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-11.