Pop-up processing method, device, equipment and medium

CN117519875BActive Publication Date: 2026-09-18BEIJING IQIYI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311517198.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2026-09-18
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

[0005]鉴于此,本申请提供了一种弹窗处理方法、装置、设备及介质,以解决半屏Activity弹窗乱弹的问题

Benefits of technology

[0040]The technical solution provided in this application obtains the current label of the target interface and, upon detecting a return message from the active object, determines whether the active object meets the preset half-screen active pop-up conditions. If the active object meets the half-screen active pop-up conditions and the current label is the same as the expected label corresponding to the active object, a synchronization message corresponding to the active object is sent. Subsequently, in the pop-up display callback notified by the synchronization message, the current label is compared with the expected label. If the label comparison result is that the labels are different, the active object is closed and put back into the pop-up queue to wait for the next opportunity to display the pop-up of the active object, ensuring that the half-screen active object pop-up can be correctly displayed on the expected label. When the label comparison result is that the labels are the same, the multi-tab control in the target interface is set to the closed state, thereby timely blocking the user from clicking the multi-tab control. The multi-tab control is only set to the open state when the pop-up of the active object is drawn on the screen. This avoids the problem of the half-screen active pop-up appearing randomly on the switched label due to the user clicking the multi-tab control to switch labels before the pop-up is drawn, thus solving the problem of random pop-ups of half-screen active pop-ups in the case of multi-tab pop-up queues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117519875B_ABST
    Figure CN117519875B_ABST
Patent Text Reader

Abstract

This application relates to a pop-up processing method, apparatus, device, and medium. The method includes: obtaining the current tab of the target interface; when a return message of the active object is detected, determining whether the active object meets the preset half-screen active pop-up conditions; if the active object meets the half-screen active pop-up conditions, then if the current tab is the same as the expected tab, sending a synchronization message corresponding to the active object, so that the current tab is compared with the expected tab again in the pop-up display callback of the synchronization message; if the tab comparison result is that the tabs are different, then closing the active object and putting the active object back into the pop-up queue; if the tab comparison result is that the tabs are the same, then setting the multi-tab control in the target interface to a closed state, and only setting the multi-tab control to an open state when the pop-up of the active object is drawn on the screen, thereby solving the problem of random pop-ups of half-screen active pop-ups in the case of multi-tab pop-up queues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of application technology, and in particular to a pop-up window processing method, apparatus, device and medium. Background Technology

[0002] With the widespread adoption of smart devices, people are increasingly relying on applications (Apps) on smart devices such as mobile phones for communication, social interaction, and entertainment.

[0003] App homepages often have multiple tabs, using an Activity component to hold different fragments for tab switching. However, a problem arises: the product team intends for a half-screen Activity popup to appear on a fixed tab, but when quickly switching tabs, the display of the half-screen Activity popup on the intended tab is uncontrollable.

[0004] Specifically, existing solutions typically determine whether the current tab matches the expected tab of the half-screen Activity popup when the half-screen Activity is launched. If the current tab matches the expected tab, the half-screen Activity popup is triggered; otherwise, it waits in the popup queue to be activated. This solution fails in scenarios involving rapid tab switching, causing the half-screen Activity popup to display on unexpected tabs during rapid tab switching, resulting in the half-screen Activity popup appearing erratically. Summary of the Invention

[0005] In view of this, this application provides a pop-up handling method, apparatus, device and medium to solve the problem of random pop-ups in half-screen Activity windows.

[0006] Firstly, this application provides a pop-up window handling method, including:

[0007] Get the current tab of the target screen;

[0008] When a message indicating that an active object has returned is detected, it is determined whether the active object meets the preset conditions for a half-screen active pop-up window.

[0009] If the activity object meets the conditions of the half-screen activity pop-up, then if the current label is the same as the expected label corresponding to the activity object, a synchronization message corresponding to the activity object is sent.

[0010] In the pop-up display callback of the synchronization message, the current tag is compared with the expected tag to obtain the tag comparison result;

[0011] If the label comparison result is that the labels are different, then close the activity object and put the activity object back into the pop-up queue;

[0012] If the label comparison result is that the labels are the same, the multi-label control in the target interface is set to the closed state, and the multi-label control is set to the open state only when the pop-up window of the active object is drawn on the screen.

[0013] Optionally, when a return message for an active object is detected, determining whether the active object meets the preset half-screen active pop-up conditions includes:

[0014] Upon first execution of the re-return message, determine whether the class information of the activity object is a half-screen activity object type.

[0015] If the class information is half-screen activity object type information, then the activity object is determined to meet the half-screen activity pop-up conditions.

[0016] Optionally, when a return message for an active object is detected, determining whether the active object meets the preset half-screen active pop-up conditions includes:

[0017] In the callback of the activity object, it is determined whether the class information of the activity object is half-screen activity object type information;

[0018] If the class information is half-screen activity object type information, and the re-return message is the first execution re-return message, then it is determined that the activity object meets the half-screen activity pop-up condition.

[0019] Optionally, the above pop-up window handling methods also include:

[0020] If it is determined that the activity object meets the conditions for the half-screen activity pop-up, and the current label is different from the expected label, the end method of the activity object is called.

[0021] The activity object is closed using the termination method.

[0022] Optionally, sending a synchronization message corresponding to the activity object when the current tag is the same as the expected tag corresponding to the activity object includes:

[0023] If the current tag is the same as the expected tag, the page display method is invoked;

[0024] The synchronization message is sent using the page display method.

[0025] Optionally, in the pop-up display callback of the synchronization message, comparing the current tag with the expected tag to obtain the tag comparison result includes:

[0026] In the pop-up display callback, it is determined whether the current tag is the same as the expected tag;

[0027] If the current label is the same as the expected label, then generate a result with the same label;

[0028] If the current label is different from the expected label, then a result indicating that the labels are different is generated.

[0029] Optionally, a flag bit is set in the response to the click event of the multi-tab, the flag bit including an enabled state and a disabled state. Setting the multi-tab control in the target interface to the closed state includes: setting the flag bit to the enabled state; setting the multi-tab control to the open state includes: setting the flag bit to the disabled state.

[0030] Optionally, the above pop-up processing method further includes: adding a frame callback operation in the preset choreographer class; determining whether the number of frame callbacks has reached a preset number; if the number of frame callbacks has reached the preset number, it indicates that the pop-up of the active object is drawn on the screen.

[0031] Secondly, this application provides a pop-up window handling device, comprising:

[0032] The current tag acquisition module is used to obtain the current tag of the target interface;

[0033] The half-screen activity pop-up judgment module is used to determine whether the activity object meets the preset half-screen activity pop-up conditions when a return message of the activity object is detected.

[0034] The synchronous message sending module is used to send a synchronous message corresponding to the active object when the active object meets the half-screen active pop-up conditions and the current tag is the same as the expected tag corresponding to the active object.

[0035] The callback tag comparison module is used to compare the current tag with the expected tag in the pop-up display callback of the synchronous message to obtain the tag comparison result;

[0036] The activity object replay module is used to close the activity object and put the activity object back into the pop-up queue when the label comparison result is that the labels are different.

[0037] The pop-up display module is used to set the multi-tab control in the target interface to a closed state when the label comparison result is the same, and to set the multi-tab control to an open state only when the pop-up of the active object is drawn on the screen.

[0038] Thirdly, this application provides an electronic device, including: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: acquire the current label of a target interface; when a return message of an active object is detected, determine whether the active object meets a preset half-screen active pop-up condition; if the active object meets the half-screen active pop-up condition, send a synchronization message corresponding to the active object if the current label is the same as the expected label corresponding to the active object; in the pop-up display callback of the synchronization message, compare the current label with the expected label to obtain a label comparison result; if the label comparison result is that the labels are different, close the active object and put the active object back into the pop-up queue; if the label comparison result is that the labels are the same, set the multi-label control in the target interface to a closed state, and only set the multi-label control to an open state when the pop-up of the active object is drawn on the screen.

[0039] Fourthly, this application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the pop-up window processing method as described in any of the preceding claims of this application.

[0040] The technical solution provided in this application obtains the current label of the target interface and, upon detecting a return message from the active object, determines whether the active object meets the preset half-screen active pop-up conditions. If the active object meets the half-screen active pop-up conditions and the current label is the same as the expected label corresponding to the active object, a synchronization message corresponding to the active object is sent. Subsequently, in the pop-up display callback notified by the synchronization message, the current label is compared with the expected label. If the label comparison result is that the labels are different, the active object is closed and put back into the pop-up queue to wait for the next opportunity to display the pop-up of the active object, ensuring that the half-screen active object pop-up can be correctly displayed on the expected label. When the label comparison result is that the labels are the same, the multi-tab control in the target interface is set to the closed state, thereby timely blocking the user from clicking the multi-tab control. The multi-tab control is only set to the open state when the pop-up of the active object is drawn on the screen. This avoids the problem of the half-screen active pop-up appearing randomly on the switched label due to the user clicking the multi-tab control to switch labels before the pop-up is drawn, thus solving the problem of random pop-ups of half-screen active pop-ups in the case of multi-tab pop-up queues. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a schematic diagram illustrating the execution of message queues in existing related technologies;

[0044] Figure 2 This is a schematic diagram illustrating communication between the client and AMS via binder in existing related technologies;

[0045] Figure 3 A flowchart illustrating the steps of a pop-up window handling method provided in this application embodiment;

[0046] Figure 4 A flowchart illustrating the steps of a pop-up window handling method provided in an optional embodiment of this application;

[0047] Figure 5 A flowchart illustrating a pop-up window handling method provided in another optional embodiment of this application;

[0048] Figure 6 A schematic diagram illustrating the internal interactions of the pop-up handling method provided as an example in this application;

[0049] Figure 7 A structural block diagram of a pop-up window processing device provided in an embodiment of this application;

[0050] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0053] First, the technical terms used in this application will be explained.

[0054] Tabs: Tabs are a common user interface element used to switch between different views or functions. They are typically located at the top or bottom of the screen and are arranged horizontally. By clicking different tabs, users can switch to the corresponding page or module.

[0055] Activity: An Activity is a fundamental component in an Android application, used to display the user interface and respond to user interactions. An application typically consists of multiple Activities, each representing an independent user interface. An Activity can be launched by other components, and can also launch other Activities.

[0056] Dialog (or pop-up): A dialog is a floating user interface element used to display short-term tasks, warnings, or other information requiring user confirmation. A dialog appears as a pop-up above the current screen and blocks other operations until the user responds. It typically contains text, buttons, and other interactive elements for simple user interaction.

[0057] In the Android system, there is an underlying message queue that continuously executes messages to drive various events and execute code logic, such as... Figure 1 As shown. For example, when a half-screen Activity triggers logic execution, it is also driven by messages, such as... Figure 1 The message Message-A in the middle of the screen will launch a half-screen Activity during the execution process.

[0058] Specifically, Android's internal design is a client / server architecture. The client communicates with the Activity Manager Service (AMS) via Binder, and manages the Activity's lifecycle by sending lifecycle-related Messages through the ActivityThread class; that is, it launches the Activity through Binder communication. After Message-A is executed, it will... Figure 2As shown, AMS sends three messages—onCreate, onStart, and onResume—via Binder communication. These messages are handled by the ActivityThread, which processes the Activity's onCreate, onStart, and onResume calls. After processing by the message handler within the ActivityThread class, the corresponding Message is sent to the message queue. Finally, in the onResume method, a new ViewRootImpl object is created, and the view is added to the window. Simultaneously, an immediately executed message, Message-C, is sent to the message queue to notify the popup's display callback. Because adding the view to the window in the onResume method ultimately triggers the drawing of a frame in ViewRootImpl—that is, the drawing of the first frame of the Activity—this drawing message is the asynchronous message Message-B. At this point, a synchronization barrier is added to the message queue. After Message-A completes execution, only asynchronous messages are executed, and Message-B, being an asynchronous drawing message, is executed first. This is the fundamental reason why popups can unexpectedly appear on other tabs. User click events are handled within asynchronous messages. Therefore, an asynchronous message (Message-B) might contain user tab-switching click events. Since asynchronous messages are processed internally by the system, tab-switching events within an asynchronous message (Message-B) must be handled by the system; programmers cannot interfere. If a user tab-switching click event is included in an asynchronous message (Message-B) but not processed in a subsequent message, the problem arises where a half-screen Activity popup is ultimately displayed on other tabs.

[0059] Although the relevant technology does trigger tab checks during rapid tab switching scenarios—specifically, it checks whether the current tab matches the expected tab of the half-screen Activity popup when the half-screen Activity is launched; if they match, the popup appears; otherwise, it waits in the popup queue to be woken up—this technology actually performs the check at the moment the popup is triggered. Because the asynchronous operations in the message queue haven't fully completed at this point, the phenomenon of random half-screen Activity popups still occurs after the check is performed at the moment the popup is triggered.

[0060] To address the technical issue of erratic pop-up windows in half-screen Activities, this application provides a pop-up processing method. This method involves obtaining the current label of the target interface and, upon detecting a return message from an activity object, determining whether the activity object meets preset half-screen activity pop-up conditions. If the activity object meets these conditions, a synchronization message corresponding to the activity object is sent if the current label matches the expected label. Furthermore, in the pop-up display callback of the synchronization message, the current label is compared with the expected label, and if the label comparison result indicates a match, the pop-up is displayed correctly. The multi-tab control in the target interface is set to a closed state to promptly prevent users from clicking on it. The multi-tab control is only turned on when the pop-up of the active object is drawn onto the screen. This avoids the problem of a half-screen active pop-up appearing randomly on the switched tab when the user clicks the multi-tab control to switch tabs before the pop-up is fully drawn. If the tab comparison result shows that the tabs are different, the active object is closed and placed back into the pop-up queue to wait for the next opportunity to display its pop-up, ensuring that the half-screen active object pop-up is correctly displayed on the expected tab.

[0061] The pop-up handling method provided in this application will be described in detail below. Figure 3 This is a flowchart illustrating the steps of a pop-up window handling method provided in an embodiment of this application. Figure 3 As shown, the pop-up window handling method provided in this application embodiment may specifically include the following steps:

[0062] Step 310: Obtain the current tab of the target interface.

[0063] The target interface can be the currently displayed screen of the app. Specifically, an abstract interface can be used to query the current tab of the target interface and retrieve that tab as its current label. For example, this interface for querying the current tab of the target interface can be implemented using the Activity object of the homepage. Tab switching can be handled in the click events of multi-tab controls to obtain the current tab of the target interface. More specifically, the homepage Activity object can be obtained through a static method within the homepage Activity. This homepage Activity object can then be used to query the tab of the target interface on the homepage, which can then be used as the current tab of the target interface.

[0064] It should be noted that when constructing a Dialog type popup, an Activity object needs to be passed in. The corresponding home page Activity object can be obtained inside the Dialog. Therefore, in this embodiment, the label of the current interface can be queried through the Activity object.

[0065] Step 320: When a message indicating that the active object has returned is detected, determine whether the active object meets the preset conditions for a half-screen active pop-up window.

[0066] In this embodiment, to address the issue of a half-screen Activity pop-up being displayed on an unexpected tab during rapid tab switching, upon detecting a return message from the activity object (i.e., before launching the activity object), it can be determined whether the return message is the first one executed. If the return message is the first one executed and the activity object's type information is the pre-set half-screen activity object type information, the activity object is determined to meet the preset half-screen activity pop-up conditions, and the process can then proceed to step 330. Conversely, if the return message is not the first one executed, and / or the activity object's type information is not the pre-set half-screen activity object type information, the activity object is determined to not meet the preset half-screen activity pop-up conditions.

[0067] Step 330: If the activity object meets the half-screen activity pop-up condition, then if the current label is the same as the expected label corresponding to the activity object, send the synchronization message corresponding to the activity object.

[0068] Specifically, before launching the active object, this embodiment, upon determining that the active object meets the preset half-screen active pop-up conditions, can determine whether the current label is the same as the expected label corresponding to the active object. If the current label and the expected label corresponding to the active object are the same, a synchronization message corresponding to the active object is sent. A series of logic can then be processed within this synchronization message to notify the pop-up display callback. It should be noted that the pop-up display callback can refer to the pop-up's display callback, such as the Dialog's Onshow callback.

[0069] Step 340: In the pop-up display callback of the synchronization message, the current tag is compared with the expected tag to obtain the tag comparison result;

[0070] Specifically, in Android's underlying architecture, asynchronous messages are executed first when a synchronization barrier exists. Only after the asynchronous message has finished executing will the synchronous Dialog's Onshow callback be executed. Therefore, this application compares the current tag with the expected tag in the synchronous message's pop-up display callback. This allows for a re-evaluation of the tag at the appropriate time for the pop-up display callback, ensuring that the asynchronous operation has been completed. This avoids the phenomenon of erratic pop-ups caused by tab switching click events in asynchronous messages not being processed by the system in a timely manner, ensuring that half-screen active object type pop-ups are displayed on the appropriate page and in the appropriate situation, thus improving the user experience.

[0071] Step 350: If the label comparison result is that the labels are different, then close the activity object and put the activity object back into the pop-up queue;

[0072] One way to close an activity object is to call a method or function to close the activity object, and then put the activity object back into the pop-up queue to wait for the next opportunity to display it. This ensures that the pop-up that the activity object needs to display is in the original pop-up queue waiting for the next opportunity to display. For example, if the current label is inconsistent with the expected label, that is, if the label comparison result is that the labels are different, the Activity's Finish method can be called to close the activity object, and the pop-up that the activity object needs to display can be recycled back into the pop-up queue to ensure that the pop-up can be displayed again when switching to the corresponding label next time.

[0073] Step 360: If the label comparison result is that the labels are the same, then the multi-label control in the target interface is set to the closed state, and the multi-label control is set to the open state only when the pop-up window of the active object is drawn on the screen.

[0074] Specifically, when the current label is the same as the expected label, considering that the multi-label control in the target interface needs to be set to the closed state before the pop-up window is fully drawn, this embodiment sets the multi-label control in the target interface to the closed state when the label comparison result is determined to be the same in the pop-up window callback, so as to promptly block the user from clicking the multi-label control. The multi-label control is only set to the open state when the pop-up window of the active object is drawn on the screen. This can avoid the pop-up window corresponding to the current label appearing on the switched label when the user clicks the multi-label control to switch labels before the pop-up window is fully drawn, thus ensuring that the half-screen active object pop-up window can be correctly displayed on the expected label.

[0075] In summary, this application embodiment obtains the current label of the target interface and, upon detecting a return message from the active object, determines whether the active object meets the preset half-screen activity pop-up conditions. If the active object meets the half-screen activity pop-up conditions, it determines whether the current label is the same as the expected label corresponding to the active object. If the current label is different from the expected label, the active object can be closed, for example, by calling the active object's Finish method. If the active object meets the half-screen activity pop-up conditions and the current label is the same as the expected label, a synchronous message corresponding to the active object is sent. In the pop-up display callback of the synchronous message, the current label is compared with the expected label, ensuring the pop-up appears on the correct label. This avoids the problem of random pop-ups caused by user label-switching clicks during asynchronous message execution, where the asynchronous message execution fails to complete the asynchronous message's execution.

[0076] In some optional embodiments, the pop-up handling method provided in this embodiment may further include: when it is determined that the activity object meets the conditions for the half-screen activity pop-up, and the current label is different from the expected label, calling the end method of the activity object; and closing the activity object through the end method of the activity object. The end method of the activity object can be used to close the activity object, such as the Finish method of Activity; this embodiment does not impose specific limitations on this.

[0077] Reference Figure 4 This is a flowchart illustrating the steps of a pop-up window handling method provided in an optional embodiment of this application. In this embodiment, the pop-up window handling method may include the following steps:

[0078] Step 410: Obtain the current tab of the target interface;

[0079] Step 420: When a message indicating that the active object has returned is detected, determine whether the active object meets the preset half-screen active pop-up conditions.

[0080] Specifically, in order to solve the problem of random pop-ups in a multi-tab pop-up queue, this embodiment can determine whether the activity object's return message is the first return message before launching the activity object. That is, it can determine whether the activity object's return message is the first execution and determine whether the activity object's type information is the pre-set half-screen activity object type information. If the activity object's return message is the first execution return message and the activity object's type information is the pre-set half-screen activity object type information, then the activity object is determined to meet the preset half-screen activity pop-up conditions.

[0081] In some optional embodiments of this application, when a return message of an active object is detected, it is determined whether the active object meets the preset half-screen active pop-up conditions, which may specifically include the following sub-steps:

[0082] Sub-step 4211: In the case of the first execution of the re-return message, determine whether the class information of the activity object is half-screen activity object type information;

[0083] Sub-step 4212: If the class information is half-screen activity object type information, then determine that the activity object meets the half-screen activity pop-up condition.

[0084] Specifically, in this embodiment, when a return message for an active object is detected, it can determine whether the return message is the first execution of the OnResume method, i.e., whether the return message is the first execution. If the return message is the first execution of the OnResume method, it can determine whether the class information of the active object is half-screen active object type information. That is, in the case of the first execution of the return message, it can determine whether the class information of the active object is half-screen active object type information. Thus, if the return message is the first execution and the type information of the active object is half-screen active object type information, and there is a requirement for expected tags, it can be determined that the active object meets the preset half-screen active pop-up conditions, and then the process can jump to step 430. However, if the return message is not the first execution and / or the type information of the active object does not belong to half-screen active object type information, it can be determined that the active object does not meet the preset half-screen active pop-up conditions, i.e., the active object does not have the requirement for expected tags and is not a half-screen active pop-up. For example, for an Activity within the system, the onResume method can be overridden. In the onResume method of the parent class BaseActivity, it can be determined whether this is the first time the OnResume method is executed, whether it is a half-screen Activity type, and whether there is a requirement for the expected tab. If so, it can be determined that the Activity meets the preset half-screen activity pop-up conditions. Then, it jumps to step 430 to execute, in order to determine whether the expected tab and the current tab of the target interface are consistent.

[0085] Considering that the onResume method can only be overridden for Activities within the system, and the onResume method of Activities introduced by third-party applications cannot be overridden, this embodiment can use the registerActivityLifecycleCallbacks method of the application object to add callbacks. In the re-return callback of the activity object, it can be determined whether the name of the Activity is the preset half-screen Activity name, and in this callback, it can be determined whether it is the first onResume. Thus, step 430 can be executed only after the above conditions are met.

[0086] In some alternative embodiments of this application, when a return message for an active object is detected, it is determined whether the active object meets the preset half-screen activity pop-up condition. Specifically, this may include: in the return callback of the active object, determining whether the class information of the active object is half-screen activity object type information; if the class information is half-screen activity object type information, and the return message is the first execution of the return message, then it is determined that the active object meets the half-screen activity pop-up condition. The return callback of the active object can be used to determine whether the class information of the active object is half-screen activity object type information and to determine whether the return message is the first execution of the return message. For example, the return callback of the active object can be the onActivityResumed callback of an Activity; the class information of the active object can be used to determine the type of the active object. For example, the class information of the active object can be the class name (className) of the Activity, which serves as the name of the Activity and can be used to determine the Activity type.

[0087] As an example of this application, before launching the Activity, the registerActivityLifecycleCallbacks method of the Application object can be called to listen for the onActivityResumed callback of the newly created Activity. In the onActivityResumed callback of the newly created Activity, it can be determined whether the onActivityResumed callback is the first OnResume and whether the Activity's className matches the expected half-screen Activity name. Thus, if the onActivityResumed callback is the first OnResume and the Activity's className matches the expected half-screen Activity name, it can be determined that the Activity meets the preset half-screen activity pop-up conditions. It should be noted that the callbacks added using the `registerActivityLifecycleCallbacks` method of the `Application` object will contain the lifecycle callbacks of all newly created Activities. Therefore, in this example, the `onActivityResumed` callback checks whether the Activity's name is the preset half-screen Activity and whether it is the first `onResume`. If the `onActivityResumed` callback is the first `onResume` and the Activity's `className` matches the expected half-screen Activity name, then the Activity is determined to meet the preset half-screen activity pop-up conditions. Then, step 430 is executed to determine whether the current tab matches the expected tab.

[0088] Step 430: If the activity object meets the half-screen activity pop-up condition, then determine whether the current label is the same as the expected label corresponding to the activity object;

[0089] Step 440: If the current label is different from the expected label, call the end method of the activity object to close the activity object;

[0090] In this embodiment, after determining that the active object meets the half-screen activity pop-up condition, it can be determined whether the current label is the same as the expected label corresponding to the active object, so as to determine whether the current tab is consistent with the expected tab. If the current tab is inconsistent with the expected tab, that is, when it is determined that the active object meets the half-screen activity pop-up condition and the current label is different from the expected label, the end method of the active object is called to close the active object through the called end method. For example, when the current tab is inconsistent with the expected tab, the Finish method of the Activity is called to close the Activity. If the current tab is inconsistent with the expected tab, that is, when it is determined that the active object meets the half-screen activity pop-up condition and the current label is the same as the expected label, then the process jumps to step 450 for execution.

[0091] Step 450: If the current tag is the same as the expected tag corresponding to the activity object, send the synchronization message corresponding to the activity object;

[0092] Specifically, in this embodiment, when it is determined that the activity object meets the conditions for a half-screen activity pop-up, and the current tab is the same as the expected tab corresponding to the activity object, a synchronization message corresponding to the activity object is sent. This synchronization message handles a series of logic steps and notifies the pop-up display callback. For example, for an internal Activity, if it is determined before launching the Activity that the Activity meets the preset conditions for a half-screen activity pop-up, and the current tab is the same as the expected tab, an immediately executed handler message can be sent as the synchronization message corresponding to the Activity. Figure 1 The message queue shown contains message Message-C, which is used in the subsequent display callback to determine whether the current tab matches the expected tab, i.e., to execute step 460.

[0093] In some optional embodiments of this application, when the current label is the same as the expected label corresponding to the activity object, sending a synchronization message corresponding to the activity object may specifically include: calling a page display method when the current label is the same as the expected label; and sending the synchronization message through the page display method. For example, before launching the Activity, in conjunction with the above example, if the Activity meets the half-screen activity pop-up condition by judging through the onActivityResumed callback of the newly created Activity, a custom onShowHandler can be called as a page display method when it is determined that the current Tab is consistent with the expected Tab. This page display method sends a message as a synchronization message corresponding to the activity object, and processes a series of logic in this synchronization message, notifying the pop-up display callback. In the pop-up display callback notified by the synchronization message, it is determined whether the current Tab is consistent with the expected Tab, i.e., step 460 is executed.

[0094] Step 460: In the pop-up display callback of the synchronization message, the current tag is compared with the expected tag to obtain the tag comparison result;

[0095] Furthermore, in this embodiment, the current tag is compared with the expected tag in the pop-up display callback of the synchronization message to obtain a tag comparison result. Specifically, this may include: in the pop-up display callback, determining whether the current tag and the expected tag are the same; if the current tag and the expected tag are the same, generating a tag same result; if the current tag and the expected tag are not the same, generating a tag different result.

[0096] Step 470: If the label comparison result is that the labels are different, then close the activity object and put the activity object back into the pop-up queue to wait for the next opportunity to display the pop-up of the activity object.

[0097] Step 480: If the label comparison result is that the labels are the same, then the multi-label control in the target interface is set to the closed state, and the multi-label control is set to the open state only when the pop-up window of the active object is drawn on the screen.

[0098] In this embodiment, when the label comparison result is that the labels are different, the active object can be closed and put back into the pop-up queue to wait for the next opportunity to display the pop-up of the active object. This ensures that the half-screen active object pop-up can be correctly displayed on the expected label. When the label comparison result is that the labels are the same, the multi-label control in the target interface is set to the closed state, which can promptly block the user from clicking the multi-label control and prevent the user from switching labels. The multi-label control is only set to the open state when the active object pop-up is drawn on the screen. This avoids the problem of the half-screen active pop-up appearing on the switched label due to the user clicking the multi-label control to switch labels before the pop-up is drawn. This solves the problem of the half-screen active pop-up appearing randomly.

[0099] In specific implementations, the visibility or disabled state of multi-tab controls can be set to prevent users from switching tabs. Therefore, in order to conveniently and promptly block multi-tab clicks, this embodiment can intercept clicks within the response tab click event. For example, a flag can be set within the response tab click event, which includes an enabled state and a disabled state. When blocking is needed, the flag is set to the enabled state (true), and when blocking is not needed, the flag is set to the disabled state (false). This achieves multi-tab click control. In some optional embodiments of this application, setting the multi-tab control in the target interface to a closed state can specifically include: setting the flag to the enabled state to promptly block multi-tab click events; setting the multi-tab control to an open state includes: setting the flag set in the response tab click event to a disabled state to achieve multi-tab click control.

[0100] Furthermore, pop-ups of half-screen active object types often contain important information or operation options. If the tab is switched before the pop-up is fully drawn, the pop-up content may only be displayed in part, or the user may not be able to see the complete pop-up content. Therefore, in this embodiment, the flag set in the multi-tab click event is disabled only when the active object pop-up is drawn on the screen, so as to wait for the pop-up to be drawn before switching the tab. This ensures that the pop-up content is fully displayed to the user, providing a better interactive experience. At the same time, it can avoid interface flickering or inconsistency, making the interface transition smoother.

[0101] Considering Android's underlying rendering mechanism, a certain number of frames of data typically need to be cached, such as three frames, to truly display the half-screen Activity popup on the screen. Therefore, this embodiment can add frame callback operations to the preset choreographer class. This ensures that the multi-tab control is only enabled after a preset number of frame callbacks have been executed, thus guaranteeing that the correct tabs appear on the half-screen Activity popup. The Android choreographer class can contain an Application Programming Interface (API) for adding frame callback operations.

[0102] Optionally, the pop-up processing method provided in this embodiment may further include: adding a frame callback operation in a preset choreographer class; determining whether the number of frame callbacks has reached a preset number; if the number of frame callbacks has reached the preset number, it indicates that the pop-up of the active object is drawn on the screen.

[0103] Reference Figure 5 The diagram illustrates a flowchart of a pop-up window handling method provided in another optional embodiment of this application. Figure 5 As shown, the pop-up window handling method provided in this application embodiment may specifically include the following steps:

[0104] Step 510: Obtain the current tab of the target interface;

[0105] Step 520: Before launching the active object, determine whether the active object meets the preset half-screen active pop-up conditions;

[0106] Step 530: If the active object meets the conditions for a half-screen active pop-up window, determine whether the current label is the same as the expected label corresponding to the active object;

[0107] Step 540: If the current label is different from the expected label, call the end method of the activity object to close the activity object;

[0108] Step 550: If the current tag is the same as the expected tag, call the page display method and send the synchronization message corresponding to the active object;

[0109] Step 560: In the pop-up display callback of the synchronization message, compare the current tag with the expected tag to obtain the tag comparison result;

[0110] Step 570: If the label comparison result is that the labels are different, then close the activity object and put the activity object back into the pop-up queue, waiting for the next opportunity to display it;

[0111] Step 580: If the tag comparison result is the same, then set the multi-tag control in the target interface to the closed state, and add a frame callback operation in the preset choreographer class.

[0112] Step 590: Determine whether the number of frame callbacks has reached a preset number;

[0113] Step 600: If the number of frame callbacks reaches the preset number, it indicates that the pop-up window of the active object is drawn on the screen, and the multi-tab control is set to the open state.

[0114] Specifically, in the interface controller, a frame callback listener can be set for the pop-up window corresponding to the current label. For example, in this embodiment, a class object can be set in the target pop-up window class. The class object inherits the display listener of the target pop-up window class, and the onShow callback method is defined in the display callback interface. In this way, the onShow callback method can be used to determine whether the number of frame callbacks has reached the preset number. If the number of frame callbacks has reached the preset number, it means that the pop-up window corresponding to the current label is drawn on the screen. If the number of frame callbacks has not reached the preset number, it means that the pop-up window corresponding to the current label has not been fully drawn on the screen.

[0115] It should be noted that, considering that not all Dialogs have a display callback set, in some embodiments of this application, a display callback interface is set in the target popup class, and the onShow callback method is defined in the display callback interface. Specifically, the class object is set when the Dialog object is initialized, that is, the display callback interface is set in the target popup class. This display callback interface defines the onShow method, so that each Dialog object will be notified when the onShow callback is executed. Therefore, when the popup is displayed, the onShow method will be triggered. In this method, it is possible to determine whether the expected tab and the current tab are the same. If the expected tab and the current tab are not the same, the popup disappearance method dismissWindow defined in the interface can be called to close the popup of the currently active object and put it back into the popup queue.

[0116] Specifically, in this embodiment, a target pop-up class can be created in the pop-up queue. This target pop-up class inherits from the pop-ups in the queue. An interface name and the defined pop-up display method `showWindow` and pop-up disappearance method `dismissWindow` can be added to the target pop-up class. This allows the `showWindow` method to be called in the pop-up display callback when the current label differs from the expected label, thus returning the half-screen pop-up of the currently active object to the pop-up queue. The target pop-up class can be a `CustomDialog` class. For example, when creating the `CustomDialog` class in the pop-up queue, an interface `CustomDialogInterface` is created to define the `showWindow` and `dismissWindow` methods. The expected tab value is set using the `setExpectedTab` method, and the `showWindow` method is called at an appropriate time to display the pop-up.

[0117] As can be seen, this embodiment implements the onShow callback interface inside the Dialog by creating a new class. That is, a class object is set in the Dialog, which inherits the Dialog's own listener onshowListener. In this way, every time the Dialog calls onShow, it will call back to the newly created class object in the Dialog. This allows all Dialogs to compare the expected tab with the actual tab obtained from the Activity object in the onShow method, ensuring that the half-screen Activity type pop-up appears on the correct tab, and solving the problem of random pop-ups of half-screen Activity type pop-ups in the case of multi-tab pop-up queues.

[0118] The preset number of times can be 1-3, and this embodiment does not impose a specific limitation. Specifically, when drawing the UI, the Android underlying caching mode includes a dual caching mechanism and a triple caching mechanism. When the Android underlying caching mode is a dual caching mechanism, the Android underlying layer has two levels of cache to store the data of two frames, and asynchronous messages such as... Figure 1After Message-B completes, the frame data containing the Dialog is placed in the cache. Therefore, it's necessary to block the tab-switching click event for another frame. That is, when Android's underlying caching mode is a double-caching mechanism, a preset number of times (1) is required before releasing multi-tab clicks to ensure the Dialog appears on the correct tab. When Android's underlying caching mode is a triple-caching mechanism, because Android has three levels of cache to store three frames of data, and the Dialog drawing takes some time while the tab-switching click event response time is relatively fast, the preset number of times in a triple-caching mechanism can be 2 or 3. Specifically, in asynchronous messages such as... Figure 1 After Message-B in the middle is executed, the data of this frame with Dialog will be placed in the cache. Subsequently, it is necessary to block the tab switching click event of two frames. That is, when the frame callback reaches 2 times, the multi-tab click is released, so as to ensure that the half-screen active object type Dialog appears on the correct tab.

[0119] Additionally, because the dialog rendering process takes some time in the triple-buffering mechanism, while the tab click event response time is relatively fast, multiple tab clicks can be enabled only when the first frame of the next popup is being rendered. This means that asynchronous messages such as... Figure 1 After Message-B is executed, the tab click event of three frames is blocked. That is, the multi-tab click is only released when the number of frame callbacks reaches 3. This embodiment does not impose specific restrictions on this.

[0120] The embodiments of this application are described below by way of example. However, it should be noted that the implementation of this application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of this application.

[0121] As an example of this application, tab switching can be performed in the click event of a multi-tab control within the homepage Activity, triggering a pop-up queue, such as... Figure 6As shown, a half-screen Activity can be displayed at the head of the pop-up queue. Specifically, before launching the Activity, the `registerActivityLifecycleCallbacks` method of the `Application` object can be used to add an `ActivityLifecycleCallback`. Within the `onActivityResumed` callback of the `ActivityLifecycleCallback`, it checks if the Activity's name matches the preset half-screen Activity name and if it's the first `onResume` call. In other words, it checks if it's the first callback within the `onResume` callback of the activity object. If it is the first callback and the Activity's name matches the expectation, an `onShow` message is sent in the `onResume` callback. Inside the `Handler`, a series of logic is processed: when the Activity meets the conditions for a half-screen pop-up and the current label matches the expected label, a custom `onShowHandler` is called as the page display method to handle the `onShow` message. Specifically, a new Dialog class can be created in the pop-up queue, inheriting from the system's Dialog class. The pop-up display method `showWindow` and the pop-up disappearance method `dismissWindow` can be implemented through the interface. Then, a new class can be created in the newly created Dialog class to implement the Dialog's internal `onShow` callback interface and inherit the Dialog's own `onshowListener`, i.e., the custom `DialogonshowListener`. In this way, each time a pop-up is displayed, the callback will be invoked to the newly created class object.

[0122] Upon receiving the pop-up display callback, the custom `DialogonshowListener` retrieves the currently displayed tab by querying the homepage Activity. This tab is then used as the current tab on the target interface. The pop-up display callback compares the currently displayed tab with the expected tab. If the displayed tab matches the expected tab, the homepage Activity object is invoked to block multi-tab click events. An `doFrame` callback is added to the Android choreographer class. This adds a frame callback operation to the preset choreographer class. The `doFrame` callback count is checked against a preset limit. If the `doFrame` callback count meets the preset limit, for example... Figure 6If the number of `doFrame` callbacks exceeds two, it can be determined that the number of `doFrame` callbacks has reached the preset number. The click event of the multi-tab control is then released, and the multi-tab control is set to the open state. If the currently displayed Tab is inconsistent with the expected Tab, the `dismissWindow` method of the pop-up is called to close the half-screen active object type pop-up and put the displayed Tab back into the pop-up queue to wait for the next opportunity to display it. This ensures that the half-screen active object pop-up can be correctly displayed on the expected tab.

[0123] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should know that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps may be performed in other orders or simultaneously.

[0124] like Figure 7 As shown in the figure, this application embodiment also provides a pop-up window processing device, including:

[0125] The current tag acquisition module 710 is used to acquire the current tag of the target interface;

[0126] The half-screen activity pop-up judgment module 720 is used to determine whether the activity object meets the preset half-screen activity pop-up conditions when a return message of the activity object is detected.

[0127] The synchronization message sending module 730 is used to send a synchronization message corresponding to the activity object when the activity object meets the half-screen activity pop-up conditions and the current tag is the same as the expected tag corresponding to the activity object.

[0128] The display callback tag comparison module 740 is used to compare the current tag with the expected tag in the pop-up display callback of the synchronous message to obtain the tag comparison result;

[0129] The pop-up display module 750 is used to set the multi-tab control in the target interface to a closed state when the label comparison result is the same, and to set the multi-tab control to an open state only when the pop-up of the active object is drawn on the screen;

[0130] The activity object replay module 760 is used to close the activity object and put the activity object back into the pop-up queue when the label comparison result is that the labels are different.

[0131] Optionally, the half-screen activity pop-up judgment module 720 includes:

[0132] The activity object type information determination submodule is used to determine whether the class information of the activity object is half-screen activity object type information when the re-return message is executed for the first time;

[0133] The first determining submodule is used to determine that the activity object meets the half-screen activity pop-up condition when the class information is half-screen activity object type information.

[0134] Optionally, the half-screen activity pop-up judgment module 720 includes:

[0135] The type information determination submodule is used to determine whether the class information of the activity object is half-screen activity object type information in the callback of the activity object's return;

[0136] The second determining submodule is used to determine that the activity object meets the half-screen activity pop-up condition when the class information is half-screen activity object type information and the re-return message is the first execution re-return message.

[0137] Optionally, the above pop-up window handling device also includes the following modules:

[0138] The end method call module is used to call the end method of the activity object when it is determined that the activity object meets the half-screen activity pop-up condition and the current label is different from the expected label;

[0139] The active object closing module is used to close the active object through the termination method.

[0140] Optionally, the synchronization message sending module 730 includes:

[0141] The display method call submodule is used to call the page display method when the current tag is the same as the expected tag;

[0142] The synchronization message sending submodule is used to send the synchronization message through the page display method.

[0143] Optionally, the display callback label comparison module 740 includes:

[0144] The tag determination submodule is used to determine whether the current tag is the same as the expected tag in the pop-up display callback.

[0145] The "Same Label Result" submodule is used to generate the "Same Label Result" when the current label is the same as the expected label.

[0146] The "Label Dissimilar Result" submodule is used to generate the "Label Dissimilar Result" when the current label is different from the expected label.

[0147] Optionally, a flag is set in the multi-tab click event response. The flag includes an enabled state and a disabled state. Setting the multi-tab control in the target interface to the closed state includes setting the flag to the enabled state; setting the multi-tab control to the open state includes setting the flag to the disabled state. The pop-up display module may include the following sub-modules:

[0148] The flag bit enable state submodule is used to set the flag bit to the enabled state. For example, when the tag comparison result is the same, the flag bit set in the multi-tag click event will be set to the enabled state, while the multi-tag control in the target interface will be set to the closed state.

[0149] The flag-disabled state submodule is used to set the flag to the disabled state. For example, when a pop-up window of an active object is drawn on the screen, the flag set in the multi-tab click event will be set to the disabled state, so that the multi-tab control in the target interface is set to the open state.

[0150] Optionally, the above-mentioned pop-up window handling device further includes:

[0151] The Frame Callback Operation module is used to add frame callback operations to preset choreographer classes;

[0152] The frame callback count determination module is used to determine whether the number of frame callbacks has reached a preset number; and when the number of frame callbacks reaches the preset number, it indicates that the pop-up window of the active object is drawn on the screen.

[0153] It should be noted that the pop-up processing device provided in the embodiments of this application can execute the pop-up processing method provided in any embodiment of this application, and has the corresponding functions and beneficial effects of executing the pop-up processing method.

[0154] In a practical implementation, the aforementioned pop-up processing device can be integrated into an electronic device. This allows the electronic device, acting as a pop-up processing device, to determine whether the active object meets the preset half-screen active pop-up conditions after obtaining the current label of the target interface and detecting a return message from the active object. If the active object meets the half-screen active pop-up conditions and the current label is the same as the expected label corresponding to the active object, a synchronization message corresponding to the active object is sent. Subsequently, in the pop-up display callback notified by the synchronization message, the current label is compared with the expected label. If the label comparison result is that the labels are different, the active object is closed, and the active object is re-enclosed. The pop-up is placed back in the pop-up queue to wait for the next opportunity to display the pop-up of the active object, ensuring that the half-screen active object pop-up can be correctly displayed on the expected label. When the label comparison result is the same, the multi-tab control in the target interface is set to the closed state, which can promptly prevent the user from clicking the multi-tab control. The multi-tab control is only set to the open state when the active object pop-up is drawn to the screen. This can avoid the problem of the half-screen active pop-up appearing on the switched label due to the user clicking the multi-tab control to switch labels before the pop-up is drawn. This solves the problem of the half-screen active pop-up appearing randomly on the switched label in the case of a multi-tab pop-up queue.

[0155] This embodiment also provides an electronic device, including at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: determine target dialogue; acquire a video segment containing the target dialogue; determine source text information based on feature information of the target dialogue; generate source video segment using the source text information; and splice the source video segment and the video segment together to generate a target video.

[0156] It should be noted that the electronic device provided in this embodiment may be composed of two or more physical entities, or it may be composed of a single physical entity. For example, the electronic device may be a personal computer (PC), a computer, a server, etc. This application embodiment does not impose specific limitations on this.

[0157] For example, such as Figure 8 As shown in the figure, this application provides an electronic device including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0158] Memory 113 is used to store computer programs;

[0159] In one embodiment of this application, when the processor 111 executes the program stored in the memory 113, it implements the steps of the pop-up processing method provided in any of the aforementioned method embodiments, including: obtaining the current label of the target interface; when a return message of an active object is detected, determining whether the active object meets the preset half-screen active pop-up condition; if the active object meets the half-screen active pop-up condition, then if the current label is the same as the expected label corresponding to the active object, sending a synchronization message corresponding to the active object; in the pop-up display callback of the synchronization message, comparing the current label with the expected label to obtain a label comparison result; if the label comparison result is that the labels are different, then closing the active object and putting the active object back into the pop-up queue; if the label comparison result is that the labels are the same, then setting the multi-label control in the target interface to a closed state, and only setting the multi-label control to an open state when the pop-up of the active object is drawn on the screen.

[0160] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the pop-up window processing method provided in any of the foregoing method embodiments.

[0161] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0162] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0163] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, and / or operations, but do not exclude the presence or addition of one or more other features, steps, operations, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a specific order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0164] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A pop-up window handling method, characterized in that, include: Get the current tab of the target screen; When a message indicating that an active object has returned is detected, it is determined whether the active object meets the preset conditions for a half-screen active pop-up window. If the activity object meets the conditions of the half-screen activity pop-up, then if the current label is the same as the expected label corresponding to the activity object, a synchronization message corresponding to the activity object is sent. In the pop-up display callback of the synchronization message, the current tag is compared with the expected tag to obtain the tag comparison result; If the label comparison result is that the labels are different, then close the activity object and put the activity object back into the pop-up queue; If the label comparison result is that the labels are the same, the multi-label control in the target interface is set to the closed state, and the multi-label control is set to the open state only when the pop-up window of the active object is drawn on the screen; If it is determined that the activity object meets the conditions for the half-screen activity pop-up, and the current label is different from the expected label, the end method of the activity object is called. The activity object is closed using the termination method.

2. The method according to claim 1, characterized in that, The step of determining whether the active object meets the preset half-screen active pop-up conditions when a return message of the active object is detected includes: Upon first execution of the re-return message, determine whether the class information of the activity object is a half-screen activity object type. If the class information is half-screen activity object type information, then the activity object is determined to meet the half-screen activity pop-up conditions.

3. The method according to claim 1, characterized in that, The step of determining whether the active object meets the preset half-screen active pop-up conditions when a return message of the active object is detected includes: In the callback of the activity object, it is determined whether the class information of the activity object is half-screen activity object type information; If the class information is half-screen activity object type information, and the re-return message is the first execution re-return message, then it is determined that the activity object meets the half-screen activity pop-up condition.

4. The method according to any one of claims 1 to 3, characterized in that, When the current tag is the same as the expected tag corresponding to the activity object, sending the synchronization message corresponding to the activity object includes: If the current tag is the same as the expected tag, the page display method is invoked; The synchronization message is sent using the page display method.

5. The method according to any one of claims 1 to 3, characterized in that, In the pop-up display callback of the synchronization message, the current tag is compared with the expected tag to obtain the tag comparison result, including: In the pop-up display callback, it is determined whether the current tag is the same as the expected tag; If the current label is the same as the expected label, then generate a result with the same label; If the current label is different from the expected label, then a result indicating that the labels are different is generated.

6. The method according to any one of claims 1 to 3, characterized in that, Also includes: Add frame callback functionality to the preset choreographer class; Determine whether the number of frame callbacks has reached a preset number; If the number of frame callbacks reaches the preset number, it indicates that the pop-up window of the active object is drawn on the screen.

7. A pop-up window handling device, characterized in that, include: The current tag acquisition module is used to obtain the current tag of the target interface; The half-screen activity pop-up judgment module is used to determine whether the activity object meets the preset half-screen activity pop-up conditions when a return message of the activity object is detected. The synchronous message sending module is used to send a synchronous message corresponding to the active object when the active object meets the half-screen active pop-up conditions and the current tag is the same as the expected tag corresponding to the active object. The callback tag comparison module is used to compare the current tag with the expected tag in the pop-up display callback of the synchronous message to obtain the tag comparison result; The pop-up display module is used to set the multi-tab control in the target interface to a closed state when the label comparison result is the same, and to set the multi-tab control to an open state only when the pop-up of the active object is drawn on the screen; The activity object replay module is used to close the activity object and put the activity object back into the pop-up queue when the label comparison result is that the labels are different. The end method call module is used to call the end method of the activity object when it is determined that the activity object meets the half-screen activity pop-up condition and the current label is different from the expected label; The active object closing module is used to close the active object through the termination method.

8. An electronic device, characterized in that, The system includes at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: acquire the current tab of the target interface; upon detecting a return message from an active object, determine whether the active object meets a preset half-screen active pop-up condition; if the active object meets the half-screen active pop-up condition, and if the current tab is the same as the expected tab corresponding to the active object, send a synchronization message corresponding to the active object; and in the pop-up display callback of the synchronization message, [the system will...]. The current label is compared with the expected label to obtain a label comparison result. If the label comparison result is that the labels are different, the activity object is closed and put back into the pop-up queue. If the label comparison result is that the labels are the same, the multi-label control in the target interface is set to the closed state, and the multi-label control is only set to the open state when the pop-up of the activity object is drawn on the screen. If it is determined that the activity object meets the half-screen activity pop-up condition and the current label is different from the expected label, the end method of the activity object is called. The activity object is closed through the end method.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the pop-up window handling method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Window popping-up task management method and device, storage medium and terminal

    CN108664308A