CN112416364A - Method for Android jump interface and receiving return value - Google Patents
Method for Android jump interface and receiving return value Download PDFInfo
- Publication number
- CN112416364A CN112416364A CN202011451173.7A CN202011451173A CN112416364A CN 112416364 A CN112416364 A CN 112416364A CN 202011451173 A CN202011451173 A CN 202011451173A CN 112416364 A CN112416364 A CN 112416364A
- Authority
- CN
- China
- Prior art keywords
- jump
- interface
- fragment
- return value
- layer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 239000012634 fragment Substances 0.000 claims abstract description 52
- 230000006870 function Effects 0.000 claims description 21
- 238000006243 chemical reaction Methods 0.000 claims description 13
- 230000009191 jumping Effects 0.000 claims description 5
- 239000004973 liquid crystal related substance Substances 0.000 description 5
- 239000000463 material Substances 0.000 description 5
- 238000000146 jump and return pulse sequence Methods 0.000 description 3
- 230000002596 correlated effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Abstract
The invention discloses a method for Android jump interface and receiving return value, which comprises the steps of creating a fragment without a view and used for applying authority, adding a newly created fragment to the foremost end of an interface through the fragment manager of the interface or the fragment, transmitting a callback function for receiving the return value into the newly created fragment, and calling a startActivityForResult method of the fragment to realize jump; the onActivityResult method overwriting the new fragment receives the processing return value and returns the return value to the creator through the callback function. The logic of the method for skipping the interface and receiving the return value is simplified, and the development efficiency is improved.
Description
Technical Field
The invention relates to the technical field of Android development, in particular to a method for jumping an interface and receiving a return value of an Android.
Background
The jump interface method provided in the Android official document jumps by a startActivityForResult method of an interface (Activity) or Fragment (Fragment), and receives a return result by an onActivityResult method of the interface or Fragment.
The existing Android mainly considers the memory, the Android bottom layer uses a Java virtual machine, and a garbage recovery mechanism is triggered under the condition of insufficient memory of Java, so that objects which are not held in the memory are destroyed.
If the method is an asynchronous mode, the background interface can be destroyed under the condition of insufficient memory, and after the foreground interface is returned after being executed, the system judges that the background interface is destroyed and can create a new interface again, so that the objects held in the callback function are not the latest, and a series of problems are caused.
The method for Android to jump to the interface and receive the return value at present can only limit the receiving of the return value in the interface or fragment, and has a limited application range; the target interface must execute a setResult method to set a return value; the request interface must rewrite the onActivityResult method, and determine which interface or fragment request is according to the returned request code.
Due to the design, code redundancy is achieved, development difficulty is increased, and software is broken down by carelessness in the judgment and conversion process, so that the use experience of a user is influenced.
Disclosure of Invention
The invention aims to provide a method for Android jump interface and receiving return value, which solves the problems mentioned in the middle of the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: a method for Android jump interface and receiving return value,
creating a fragment without a view for applying for permission, adding the newly created fragment to the foremost end of the interface through the interface or the fragment manager of the fragment, transmitting a callback function for receiving a return value into the newly created fragment, and calling a startActivityForResult method of the fragment to realize jumping;
the onActivityResult method overwriting the new fragment receives the processing return value and returns the return value to the creator through the callback function.
Preferably, the first and second liquid crystal materials are,
extracting a creating window from an Android application program;
determining a code of a fragment to be created, reading the required code, and encrypting the read code;
and performing multi-style combination on the codes read differently, and forming a FragmentManager through various diversified codes.
Preferably, the first and second liquid crystal materials are,
creating a program control conversion service link between the interface and the front end of the interface, analyzing and converting the newly created fragments through the program control conversion service link, and obtaining analyzed codes and converted parameters;
the parsed code and translated parameters exist in single or list form and are returned to the front-most of the interface by the FragmentManager.
Preferably, the first and second liquid crystal materials are,
and a plurality of different list protocols are produced in the newly created fragment, the plurality of list protocols operate independently, and protocol configurations exist among the plurality of list protocols and are used for acquiring callback functions of return values.
Preferably, the first and second liquid crystal materials are,
a multi-element jump layer and a storage protocol layer exist in the sequence control conversion service link;
the multi-element jump layer is linked with the storage protocol layer and is used for multi-element conversion callback function, the mark value of the first unit jump layer is 1, the mark value of the next unit jump layer is 1-1, 1-2,1-3, and so on;
when the first unit jump layer returns fragments through a function, the next unit jump layer is arranged in the jump ring layer in sequence.
Preferably, the first and second liquid crystal materials are,
the storage protocol layer is used for storing a callback function of the jump of the multiple jump layers, the storage protocol layer is internally provided with a plurality of single storage layers, each single storage layer is correlated, and the plurality of single storage layers can be combined into the multiple storage layer in parallel and used for storing the jump information of the multiple jump layers.
Compared with the prior art, the invention has the beneficial effects that:
the Android interface jump and return value receiving method simplifies the logic of the jump interface and return value receiving method, and improves development efficiency.
Drawings
FIG. 1 is a schematic flowchart illustrating a method for receiving a return value and an Android jump interface according to the present invention;
Detailed Description
The technical solutions in the embodiments of the present invention will be described below in detail with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the first embodiment, the first step is,
referring to fig. 1, in an embodiment of the present invention, a method for Android jump interface and receiving a return value,
creating a fragment without a view for applying for permission, adding the newly created fragment to the foremost end of the interface through the interface or the fragment manager of the fragment, transmitting a callback function for receiving a return value into the newly created fragment, and calling a startActivityForResult method of the fragment to realize jumping;
the onActivityResult method overwriting the new fragment receives the processing return value and returns the return value to the creator through the callback function.
In the second embodiment, the first embodiment of the method,
a method for Android jump interface and receiving return value,
creating a fragment without a view for applying for permission, adding the newly created fragment to the foremost end of the interface through the interface or the fragment manager of the fragment, transmitting a callback function for receiving a return value into the newly created fragment, and calling a startActivityForResult method of the fragment to realize jumping;
the onActivityResult method overwriting the new fragment receives the processing return value and returns the return value to the creator through the callback function.
Extracting a creating window from an Android application program;
determining a code of a fragment to be created, reading the required code, and encrypting the read code;
and performing multi-style combination on the codes read differently, and forming a FragmentManager through various diversified codes.
Creating a program control conversion service link between the interface and the front end of the interface, analyzing and converting the newly created fragments through the program control conversion service link, and obtaining analyzed codes and converted parameters;
the parsed code and translated parameters exist in single or list form and are returned to the front-most of the interface by the FragmentManager.
And a plurality of different list protocols are produced in the newly created fragment, the plurality of list protocols operate independently, and protocol configurations exist among the plurality of list protocols and are used for acquiring callback functions of return values.
A multi-element jump layer and a storage protocol layer exist in the sequence control conversion service link;
the multi-element jump layer is linked with the storage protocol layer and is used for multi-element conversion callback function, the mark value of the first unit jump layer is 1, the mark value of the next unit jump layer is 1-1, 1-2,1-3, and so on;
when the first unit jump layer returns fragments through a function, the next unit jump layer is arranged in the jump ring layer in sequence.
The storage protocol layer is used for storing a callback function of the jump of the multiple jump layers, the storage protocol layer is internally provided with a plurality of single storage layers, each single storage layer is correlated, and the plurality of single storage layers can be combined into the multiple storage layer in parallel and used for storing the jump information of the multiple jump layers.
In conclusion, the method for Android interface jump and return value receiving simplifies the logic of the method for interface jump and return value receiving, and improves development efficiency.
Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.
Claims (6)
1. A method for Android jump interface and receiving return value is characterized in that,
creating a fragment without a view for applying for permission, adding the newly created fragment to the foremost end of the interface through the interface or the fragment manager of the fragment, transmitting a callback function for receiving a return value into the newly created fragment, and calling a startActivityForResult method of the fragment to realize jumping;
the onActivityResult method overwriting the new fragment receives the processing return value and returns the return value to the creator through the callback function.
2. The Android jump interface of claim 1 and the method of receiving a return value,
extracting a creating window from an Android application program;
determining a code of a fragment to be created, reading the required code, and encrypting the read code;
and performing multi-style combination on the codes read differently, and forming a FragmentManager through various diversified codes.
3. The Android jump interface of claim 1 and the method of receiving a return value,
creating a program control conversion service link between the interface and the front end of the interface, analyzing and converting the newly created fragments through the program control conversion service link, and obtaining analyzed codes and converted parameters;
the parsed code and translated parameters exist in single or list form and are returned to the front-most of the interface by the FragmentManager.
4. The Android jump interface and return value receiving method of claim 1, wherein a plurality of different list protocols are produced in the newly created fragment, the plurality of list protocols run independently of each other, and there is a protocol configuration between the plurality of list protocols for obtaining the callback function of the return value.
5. The Android jump interface of claim 3 and the method of receiving a return value,
a multi-element jump layer and a storage protocol layer exist in the sequence control conversion service link;
the multi-element jump layer is linked with the storage protocol layer and is used for multi-element conversion callback function, the mark value of the first unit jump layer is 1, the mark value of the next unit jump layer is 1-1, 1-2,1-3, and so on;
when the first unit jump layer returns fragments through a function, the next unit jump layer is arranged in the jump ring layer in sequence.
6. The Android jump interface and return value receiving method of claim 5, wherein the storage protocol layer is configured to store callback functions of multiple jump layer jumps, and a plurality of single storage layers are provided in the storage protocol layer, and each single storage layer is associated with each other, and the plurality of single storage layers can be combined in parallel to form a multiple storage layer for storing information of the multiple jump layer jumps.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011451173.7A CN112416364A (en) | 2020-12-11 | 2020-12-11 | Method for Android jump interface and receiving return value |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011451173.7A CN112416364A (en) | 2020-12-11 | 2020-12-11 | Method for Android jump interface and receiving return value |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112416364A true CN112416364A (en) | 2021-02-26 |
Family
ID=74775513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011451173.7A Pending CN112416364A (en) | 2020-12-11 | 2020-12-11 | Method for Android jump interface and receiving return value |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112416364A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107729014A (en) * | 2017-09-06 | 2018-02-23 | 北京五八到家信息技术有限公司 | A kind of method for page jump and structure based on Android |
US20180285131A1 (en) * | 2015-12-21 | 2018-10-04 | Peking University | A method for assembling Android application based on application content |
CN111079125A (en) * | 2019-12-23 | 2020-04-28 | 飞天诚信科技股份有限公司 | Method and device for calling third-party library dynamic lifting authority by application program |
CN111367590A (en) * | 2020-02-27 | 2020-07-03 | 北京字节跳动网络技术有限公司 | Interrupt event processing method and device |
CN111444453A (en) * | 2020-02-27 | 2020-07-24 | 中国平安人寿保险股份有限公司 | Page return data processing method and device |
-
2020
- 2020-12-11 CN CN202011451173.7A patent/CN112416364A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180285131A1 (en) * | 2015-12-21 | 2018-10-04 | Peking University | A method for assembling Android application based on application content |
CN107729014A (en) * | 2017-09-06 | 2018-02-23 | 北京五八到家信息技术有限公司 | A kind of method for page jump and structure based on Android |
CN111079125A (en) * | 2019-12-23 | 2020-04-28 | 飞天诚信科技股份有限公司 | Method and device for calling third-party library dynamic lifting authority by application program |
CN111367590A (en) * | 2020-02-27 | 2020-07-03 | 北京字节跳动网络技术有限公司 | Interrupt event processing method and device |
CN111444453A (en) * | 2020-02-27 | 2020-07-24 | 中国平安人寿保险股份有限公司 | Page return data processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111078318B (en) | Processing method, device and system of configuration file and storage medium | |
US6983460B1 (en) | Method for loading applications into a multiapplication embedded system equipped with data processing resources, corresponding embedded system and execution method | |
CN102132289B (en) | Method and device for code obfuscation | |
CN105579955A (en) | Application control flow models | |
TW201232294A (en) | Formatting data by example | |
EP2933726B1 (en) | Apparatus, system and method for application log data processing | |
CN106844607B (en) | SQLite data recovery method suitable for non-integer main key and idle block combination | |
CN105975311A (en) | Application startup method and device | |
CN107742078A (en) | A kind of automatic hulling method of general DEX and system | |
CN110750415A (en) | Interface service configuration method, device, medium and computer equipment | |
CN107329836B (en) | Multi-system memory management method and device and mobile terminal | |
CN107608821B (en) | Data reading method, device and equipment based on erasure codes | |
US20080196009A1 (en) | Apparatus and method for componentizing legacy system | |
CN108196937B (en) | Method and device for processing character string object, computer equipment and storage medium | |
CN112416364A (en) | Method for Android jump interface and receiving return value | |
CN106295327B (en) | Executable file reinforcing method and device | |
CN111666257A (en) | File fragment storage method, device, equipment and storage medium | |
CN109683995A (en) | A method of it being packaged block, verifying block and intelligent contract and executes | |
CN113721928A (en) | Binary analysis-based dynamic library clipping method | |
KR101329976B1 (en) | Method and system for reporting the result of analyzing log | |
CN112069236A (en) | Associated file display method, device, equipment and storage medium | |
CN111090854A (en) | Target program execution and conversion method, device, terminal and storage medium | |
CN111061538A (en) | Memory optimization method and system for multiple Lua virtual machines | |
CN111241191A (en) | Database synchronization method and device | |
CN111026283B (en) | IP address input method, device, server and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220425 Address after: No. 36 and 37, 11th floor, Seattle business building, No. 69, Xi'an south road, Jinniu District, Chengdu, Sichuan 610000 Applicant after: SICHUAN BUSINESS EASY CO.,LTD. Address before: No. 1506, 15th floor, unit 1, building 2, No. 1537, middle section of Jiannan Avenue, high tech Zone, Chengdu, Sichuan 610000 Applicant before: Chengdu Shangtong Digital Technology Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210226 |
|
RJ01 | Rejection of invention patent application after publication |