WO2019136843A1 - Method, storage medium, device and system for starting page in android system - Google Patents
Method, storage medium, device and system for starting page in android system Download PDFInfo
- Publication number
- WO2019136843A1 WO2019136843A1 PCT/CN2018/081288 CN2018081288W WO2019136843A1 WO 2019136843 A1 WO2019136843 A1 WO 2019136843A1 CN 2018081288 W CN2018081288 W CN 2018081288W WO 2019136843 A1 WO2019136843 A1 WO 2019136843A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- page
- function
- target
- stored
- startactivity
- Prior art date
Links
Images
Classifications
-
- 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/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Definitions
- the present invention relates to the field of computer communication technologies, and in particular, to a method, a storage medium, a device and a system for starting a page in an Android system.
- the method of starting the page in Android is usually to call the startActivity method in the context class to start the activity.
- the traditional startup method has many defects: for example, when the page is started, the parameter needs to be manually configured to manually build the intent object. Set the corresponding parameters to the intent object to start; secondly, the startup animation involved in the startup process needs to be written, and each time you start, you need to write the startup animation of the corresponding startup page, which will result in many Redundant code exists and it is very inconvenient to manage the startup mode.
- the object of the present invention is to provide a method, a storage medium, a device and a system for starting a page in an Android system, which effectively realizes the convenience of parameter transmission when starting a page, and reduces the startup page code. Redundancy also improves code maintainability and scalability.
- the technical solution adopted by the present invention is: a method for starting a page in an Android system, including:
- StartManager management class Create a StartManager management class, define the startActivity method in the StartManager management class, and define the target object and the params object in the startActivity method.
- the class object of the target address to be started is obtained and stored by the target object, and the information content required for the jump is acquired and stored by the param object;
- the intent object is created, and the intent object acquires the class name of the target address to be started stored in the target object and the information content required for the jump stored by the param object;
- Start the startActivity method in the Android context object pass the intent object to the startActivity method in the context object, and start the target page.
- the target object includes a setClass function and a getClass function; the class name of the target address to be started is stored by the setclass function, and the class name of the target address to be started stored by the setclass function is obtained by the getClass function and marked. Is the targetClass.
- the param object includes a put function and a get function; the put function stores the information content required for the jump, and the get function sequentially extracts the information content required for the jump stored in the put function.
- the class name of the target address to be started in the target object is set to the intent object by calling the setClass function in the intent object;
- the bundle object is obtained by calling the getBundle method in the intent object, and calling get
- the function sequentially extracts the information content required for the jump stored in the put function, and encapsulates the information content required for the jump in the param object into the bundle object by calling the putString method in the bundle object.
- the type of the param object is set to the key value pair type, and the key and the key value in the param object are all set to the string type.
- the present invention also discloses a storage medium having stored thereon a computer program for implementing a method of launching a page in an Android system when the computer program is executed by a processor.
- the invention also discloses an electronic device comprising a memory and a processor, wherein the memory stores a computer program running on the processor: a method for starting a page in the Android system when the processor executes the computer program.
- the invention also discloses a system for starting a page in an Android system, comprising:
- the StartManager management class module includes a startActivity method, the startActivity method includes a target object and a params object; the target object is used to acquire and store a class name of a target address to be started, and the param object is used to acquire and store the hop. Transfer the required information content;
- An intent object module configured to obtain a class name of a target address to be started stored in the target object and a information content required for a jump stored by the param object;
- the page startup module is configured to start a startActivity method in an Android system context object, and send an intent object to a startActivity method in the context object to start a target page.
- the system for starting a page in the Android system further includes an animation effect setting module, and the animation effect setting module is configured to set an animation during a page startup process by calling an overridePendingTransition function after the execution of the startActivity method is completed. effect.
- the target object and the params object in the StartManager management class can effectively obtain the class name of the target address to be started and the information content required for the jump and transmit it to the information content.
- the intent object implements the convenience of parameter passing when the page is launched, avoiding the need for developers to convert themselves each time they jump.
- the startup animation can be maintained and managed uniformly, and the startup animation of the corresponding startup page is not required to be started every time, the redundancy of the startup page code is reduced, and the maintainability and expansion of the code are improved. Sex.
- FIG. 1 is a schematic flowchart of a method for starting a page in an Android system according to an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of a system for starting a page in an Android system according to an embodiment of the present invention.
- Context object a context object in Android
- the startActivity method a method in the context object in the Android system, is used to start an activity
- An activity is an interactive interface that fills the entire window or floats on other windows;
- the intent object, intent is a runtime binding mechanism in the Android system, used to connect two different components in the process of running the program; to pass an intent object to the startActivity method in the context object, you can start an activity.
- an embodiment of the present invention provides a method for starting a page in an Android system, including:
- S1 create a StartManager management class, define a startActivity method in the StartManager management class, and define a target object and a params object in the startActivity method;
- the target object and the params object created in the present invention can effectively obtain the class name of the target address to be started and the information content required for the jump and pass it to the intent object.
- the convenience of parameter passing when starting the startup page avoids the need for developers to convert themselves each time they jump.
- the target object includes the setClass function and the getClass function; the class name of the target address to be started is stored by the setclass function, and the class name of the target address to be started stored by the setclass function is obtained by the getClass function and marked as targetClass.
- the target object represents the target object, that is, the activity page that needs to be started.
- each class has a unique package name and class name, that is, the file with the same package name and class name in the same app does not exist. . This feature is used to hold a reference to a class object in the target object, and class represents the type of a class.
- the param object includes a put function and a get function; the put function stores the information content required for the jump, and the get function sequentially extracts the information content required for the jump stored in the put function.
- the Param object is mainly used to transfer information when jumping.
- the param object is designed as an object of type map ⁇ String, String>, which is a key-value pair type. data.
- the key-value pair type data has a property key that is unique. The value is not unique. That is, the data is uniquely marked by the key in the map ⁇ String, String> object, and the key is set to the String type (string). Type), whose value is also of type String.
- the animation effect of the page startup process is set by calling the overridePendingTransition function, and the startup animation can be uniformly maintained and managed, and the startup animation of the corresponding startup page is not required to be started each time, and the startup page is lowered.
- Code redundancy also improves code maintainability and scalability.
- the overridePendingTransition(R.anim.open_in, R.anim.open_out); function is called to set the animation effect during the startup process, where R.anim.open_in and R.anim.open_out are animations for entering and exiting animations.
- the description file through the processing of this method, ensures that the page exit and the entered animation are uniformly managed when the page is switched.
- the embodiment of the invention further discloses a storage medium on which a computer program is stored, and when the computer program is executed by the processor, a method for starting a page in the Android system is implemented.
- the embodiment of the invention further discloses an electronic device, comprising a memory and a processor, wherein the memory stores a computer program running on the processor, and the processor implements a method for starting a page in the Android system when the computer program is executed.
- an embodiment of the present invention further discloses a system for starting a page in an Android system, including:
- the StartManager management class module includes a startActivity method, the startActivity method includes a target object and a params object; the target object is used to acquire and store a class name of a target address to be started, and the param object is used to acquire and store information required for the jump. content;
- the intent object module the intent object module is used to obtain the class name of the target address to be started stored in the target object and the information content required for the jump of the param object storage;
- the page startup module is used to start the startActivity method in the Android system context object, and the intent object is sent to the startActivity method in the context object to start the target page.
- the system for starting the page in the Android system further includes an animation effect setting module, and the animation effect setting module is used to set the animation effect during the page startup process by calling the overridePendingTransition function after the startActivity method is executed.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to the technical field of computer communication, and disclosed thereby are a method, storage medium, device and system for starting a page in an Android system; by means of creating a StartManager management class, the invention defines a startActivity method in the StartManager management class and defines a target object and a params object in the startActivity method. The class name of a target address requiring starting is obtained and stored by means of the target object, and information content required for jump is obtained and stored by means of the param object. The StartManager management class created in the present invention, the target object and the params object may effectively make parameter transmission convenient when a page is started. The invention may uniformly maintain and manage a startup animation without needing to write a startup animation of a corresponding startup page each time during startup, thereby reducing the redundancy of the startup page code and improving the maintainability and expandability of the code.
Description
本发明涉及计算机通信技术领域,具体涉及一种安卓***中启动页面的方法、存储介质、设备及***。The present invention relates to the field of computer communication technologies, and in particular, to a method, a storage medium, a device and a system for starting a page in an Android system.
在Android中启动页面的方法通常是调用context类中的startActivity方法来对Activity进行启动操作,传统的这种启动方式存在很多缺陷:例如在启动页面的时候需要传递参数需要人为手动的构建intent对象并将相应的参数设置到intent对象中来进行启动;其次,启动过程中涉及到的启动动画需要进行编写,每次启动的时候都需要编写相应的启动页面的启动动画,这样就会导致会有许多冗余的代码存在,非常不方便启动方式的管理。The method of starting the page in Android is usually to call the startActivity method in the context class to start the activity. The traditional startup method has many defects: for example, when the page is started, the parameter needs to be manually configured to manually build the intent object. Set the corresponding parameters to the intent object to start; secondly, the startup animation involved in the startup process needs to be written, and each time you start, you need to write the startup animation of the corresponding startup page, which will result in many Redundant code exists and it is very inconvenient to manage the startup mode.
发明内容Summary of the invention
针对现有技术中存在的缺陷,本发明的目的在于提供一种安卓***中启动页面的方法、存储介质、设备及***,有效的实现启动页面的时候参数传递的便捷性,降低启动页面代码的冗余性同时提高代码的可维护性和扩展性。Aiming at the defects existing in the prior art, the object of the present invention is to provide a method, a storage medium, a device and a system for starting a page in an Android system, which effectively realizes the convenience of parameter transmission when starting a page, and reduces the startup page code. Redundancy also improves code maintainability and scalability.
为达到以上目的,本发明采取的技术方案是:一种安卓***中启动页面的方法,包括:To achieve the above objective, the technical solution adopted by the present invention is: a method for starting a page in an Android system, including:
创建StartManager管理类,在StartManager管理类中定义startActivity方法,在startActivity方法中定义target对象和params对象;Create a StartManager management class, define the startActivity method in the StartManager management class, and define the target object and the params object in the startActivity method.
通过target对象获取并存储需启动的目标地址的类名,通过param对象获取并存储跳转需要的信息内容;The class object of the target address to be started is obtained and stored by the target object, and the information content required for the jump is acquired and stored by the param object;
创建intent对象,通过intent对象获取target对象中存储的需启动的目标地址的类名和param对象存储的跳转需要的信息内容;The intent object is created, and the intent object acquires the class name of the target address to be started stored in the target object and the information content required for the jump stored by the param object;
启动安卓***context对象中的startActivity方法,向context对象中的startActivity方法传递intent对象,启动目标页面。Start the startActivity method in the Android context object, pass the intent object to the startActivity method in the context object, and start the target page.
在上述技术方案的基础上,所述target对象包括setClass函数和getClass函数;通过setclass函数存储需启动的目标地址的类名,通过getClass函数获取setclass函数存储的需启动的目标地址的类名并标记为targetClass。On the basis of the above technical solution, the target object includes a setClass function and a getClass function; the class name of the target address to be started is stored by the setclass function, and the class name of the target address to be started stored by the setclass function is obtained by the getClass function and marked. Is the targetClass.
在上述技术方案的基础上,所述param对象包括put函数和get函数;通过put函数存储跳转需要的信息内容,通过get函数依次取出put函数中存储的跳转需要的信息内容。On the basis of the above technical solution, the param object includes a put function and a get function; the put function stores the information content required for the jump, and the get function sequentially extracts the information content required for the jump stored in the put function.
在上述技术方案的基础上,通过调用intent对象中的setClass函数将所述target对象中需启动的目标地址的类名设置到intent对象中;通过调用intent对象中的getBundle方法获取bundle对象,调用get函数依次取出put函数中存储的跳转需要的信息内容,通过调用bundle对象中的putString方法将所述param对象中的跳转需要的信息内容封装到bundle对象中。On the basis of the above technical solution, the class name of the target address to be started in the target object is set to the intent object by calling the setClass function in the intent object; the bundle object is obtained by calling the getBundle method in the intent object, and calling get The function sequentially extracts the information content required for the jump stored in the put function, and encapsulates the information content required for the jump in the param object into the bundle object by calling the putString method in the bundle object.
在上述技术方案的基础上,将param对象的类型设置为键值对类型,将param对象中的键及键值均设置为字符串类型。On the basis of the above technical solution, the type of the param object is set to the key value pair type, and the key and the key value in the param object are all set to the string type.
在上述技术方案的基础上,在startActivity方法执行完成后,通过调用overridePendingTransition函数设置页面启动过程中的动画效果。On the basis of the above technical solution, after the execution of the startActivity method is completed, the animation effect during the page startup process is set by calling the overridePendingTransition function.
本发明还公开了一种存储介质,该存储介质上存储有计算机程 序:所述计算机程序被处理器执行时实现安卓***中启动页面的方法。The present invention also discloses a storage medium having stored thereon a computer program for implementing a method of launching a page in an Android system when the computer program is executed by a processor.
本发明还公开了一种电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序:处理器执行计算机程序时实现安卓***中启动页面的方法。The invention also discloses an electronic device comprising a memory and a processor, wherein the memory stores a computer program running on the processor: a method for starting a page in the Android system when the processor executes the computer program.
本发明还公开了一种安卓***中启动页面的***,包括:The invention also discloses a system for starting a page in an Android system, comprising:
StartManager管理类模块,所述StartManager管理类模块包括startActivity方法,所述startActivity方法包括target对象和params对象;target对象用于获取并存储需启动的目标地址的类名,param对象用于获取并存储跳转需要的信息内容;The StartManager management class module, the StartManager management class module includes a startActivity method, the startActivity method includes a target object and a params object; the target object is used to acquire and store a class name of a target address to be started, and the param object is used to acquire and store the hop. Transfer the required information content;
intent对象模块,所述intent对象模块用于获取target对象中存储的需启动的目标地址的类名和param对象存储的跳转需要的信息内容;An intent object module, the intent object module is configured to obtain a class name of a target address to be started stored in the target object and a information content required for a jump stored by the param object;
页面启动模块,所述页面启动模块用于启动安卓***context对象中的startActivity方法,向context对象中的startActivity方法传递intent对象,启动目标页面。The page startup module is configured to start a startActivity method in an Android system context object, and send an intent object to a startActivity method in the context object to start a target page.
在上述技术方案的基础上,所述安卓***中启动页面的***还包括动画效果设置模块,所述动画效果设置模块用于在startActivity方法执行完成后,通过调用overridePendingTransition函数设置页面启动过程中的动画效果。On the basis of the foregoing technical solution, the system for starting a page in the Android system further includes an animation effect setting module, and the animation effect setting module is configured to set an animation during a page startup process by calling an overridePendingTransition function after the execution of the startActivity method is completed. effect.
与现有技术相比,本发明的优点在于:The advantages of the present invention over the prior art are:
(1)通过本发明中创建的StartManager管理类以及target对象、params对象,通过StartManager管理类中的target对象、params对象能够有效获取需启动的目标地址的类名和跳转需要的信息内容并传递给intent对象,实现启动页面的时候参数传递的便捷性,避免每次 跳转的时候开发者都需要自行转换。(1) By using the StartManager management class, the target object, and the params object created in the present invention, the target object and the params object in the StartManager management class can effectively obtain the class name of the target address to be started and the information content required for the jump and transmit it to the information content. The intent object implements the convenience of parameter passing when the page is launched, avoiding the need for developers to convert themselves each time they jump.
(2)通过本发明能够统一的对启动动画进行维护和管理,无需每次启动的时候都编写相应的启动页面的启动动画,降低启动页面代码的冗余性同时提高代码的可维护性和扩展性。(2) Through the invention, the startup animation can be maintained and managed uniformly, and the startup animation of the corresponding startup page is not required to be started every time, the redundancy of the startup page code is reduced, and the maintainability and expansion of the code are improved. Sex.
图1为本发明实施例中安卓***中启动页面的方法的流程示意图;1 is a schematic flowchart of a method for starting a page in an Android system according to an embodiment of the present invention;
图2为本发明实施例中安卓***中启动页面的***的结构示意图。FIG. 2 is a schematic structural diagram of a system for starting a page in an Android system according to an embodiment of the present invention.
以下结合附图及实施例对本发明作进一步详细说明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
术语说明:Explanation of terms:
context对象,安卓***中的上下文对象;Context object, a context object in Android;
startActivity方法,安卓***中的上下文对象中的一个方法,用以启动一个activity;The startActivity method, a method in the context object in the Android system, is used to start an activity;
activity就是布满整个窗口或者悬浮于其他窗口上的交互界面;An activity is an interactive interface that fills the entire window or floats on other windows;
intent对象,intent是安卓***中的一种运行时绑定机制,用于在程序运行的过程中连接两个不同的组件;向context对象中的startActivity方法传递一个intent对象,可以启动一个activity。The intent object, intent is a runtime binding mechanism in the Android system, used to connect two different components in the process of running the program; to pass an intent object to the startActivity method in the context object, you can start an activity.
参见图1所示,本发明实施例提供一种安卓***中启动页面的方法,包括:As shown in FIG. 1 , an embodiment of the present invention provides a method for starting a page in an Android system, including:
S1,创建StartManager管理类,在StartManager管理类中定义startActivity方法,在startActivity方法中定义target对象和params对象;S1, create a StartManager management class, define a startActivity method in the StartManager management class, and define a target object and a params object in the startActivity method;
S2,通过target对象获取并存储需启动的目标地址的类名,通过param对象获取并存储跳转需要的信息内容;S2, acquiring and storing the class name of the target address to be started by the target object, and acquiring and storing the information content required for the jump through the param object;
S3,创建intent对象,通过intent对象获取target对象中存储的需启动的目标地址的类名和param对象存储的跳转需要的信息内容;S3, creating an intent object, obtaining the class name of the target address to be started and the information content required for the jump of the param object stored in the target object through the intent object;
S4,启动安卓***context对象中的startActivity方法,向context对象中的startActivity方法传递intent对象,启动目标页面。S4, start the startActivity method in the Android context object, and pass the intent object to the startActivity method in the context object to start the target page.
通过本发明中创建的StartManager管理类以及target对象、params对象,通过StartManager管理类中的target对象、params对象能够有效获取需启动的目标地址的类名和跳转需要的信息内容并传递给intent对象,实现启动页面的时候参数传递的便捷性,避免每次跳转的时候开发者都需要自行转换。Through the StartManager management class, the target object, and the params object created in the present invention, the target object and the params object in the StartManager management class can effectively obtain the class name of the target address to be started and the information content required for the jump and pass it to the intent object. The convenience of parameter passing when starting the startup page avoids the need for developers to convert themselves each time they jump.
target对象包括setClass函数和getClass函数;通过setclass函数存储需启动的目标地址的类名,通过getClass函数获取setclass函数存储的需启动的目标地址的类名并标记为targetClass。The target object includes the setClass function and the getClass function; the class name of the target address to be started is stored by the setclass function, and the class name of the target address to be started stored by the setclass function is obtained by the getClass function and marked as targetClass.
target对象表示的是目标对象,即需要被启动的activity页面,在Java语言中每一个类都具有唯一的包名和类名,即在同一个app中包名和类名完全相同的文件是不存在的。利用了此特性在target对象中持有一个class对象的引用,class表示的是一个类的类型。The target object represents the target object, that is, the activity page that needs to be started. In the Java language, each class has a unique package name and class name, that is, the file with the same package name and class name in the same app does not exist. . This feature is used to hold a reference to a class object in the target object, and class represents the type of a class.
param对象包括put函数和get函数;通过put函数存储跳转需要的信息内容,通过get函数依次取出put函数中存储的跳转需要的信息内容。The param object includes a put function and a get function; the put function stores the information content required for the jump, and the get function sequentially extracts the information content required for the jump stored in the put function.
通过调用intent对象中的setClass函数将所述target对象中需启动的目标地址的类名设置到intent对象中;通过调用intent对象中的getBundle方法获取bundle对象,调用get函数依次取出put函数中存储的跳转需要的信息内容,通过调用bundle对象中的putString方法 将所述param对象中的跳转需要的信息内容封装到bundle对象中。Set the class name of the target address to be started in the target object to the intent object by calling the setClass function in the intent object; obtain the bundle object by calling the getBundle method in the intent object, and call the get function to sequentially store the stored in the put function. Jump the required information content, and encapsulate the information content required by the jump in the param object into the bundle object by calling the putString method in the bundle object.
将param对象的类型设置为键值对类型,将param对象中的键及键值均设置为字符串类型。Param对象主要是用于在跳转的时候传递信息使用的,为了方便设置和解析出传递的消息内容,将param对象设计成一个map<String,String>类型的对象,也就是键值对类型的数据。键值对类型的数据有一个特性键是唯一的,值是不唯一的,即在map<String,String>对象中通过键来唯一标示一个数据,并且将其中的键设置为String类型(字符串类型),其值也是String类型的。Set the type of the param object to the key-value pair type, and set the key and key value in the param object to the string type. The Param object is mainly used to transfer information when jumping. To facilitate setting and parsing the content of the message, the param object is designed as an object of type map<String, String>, which is a key-value pair type. data. The key-value pair type data has a property key that is unique. The value is not unique. That is, the data is uniquely marked by the key in the map<String, String> object, and the key is set to the String type (string). Type), whose value is also of type String.
在startActivity方法执行完成后,通过调用overridePendingTransition函数设置页面启动过程中的动画效果,能够统一的对启动动画进行维护和管理,无需每次启动的时候都编写相应的启动页面的启动动画,降低启动页面代码的冗余性同时提高代码的可维护性和扩展性。After the execution of the startActivity method is completed, the animation effect of the page startup process is set by calling the overridePendingTransition function, and the startup animation can be uniformly maintained and managed, and the startup animation of the corresponding startup page is not required to be started each time, and the startup page is lowered. Code redundancy also improves code maintainability and scalability.
具体的说,调用overridePendingTransition(R.anim.open_in,R.anim.open_out);函数来设置启动过程中的动画效果,其中R.anim.open_in和R.anim.open_out是动画的进入和退出的动画描述文件,通过此方法的处理能够确保页面切换的时候页面退出和进入的动画得到统一的管理。Specifically, the overridePendingTransition(R.anim.open_in, R.anim.open_out); function is called to set the animation effect during the startup process, where R.anim.open_in and R.anim.open_out are animations for entering and exiting animations. The description file, through the processing of this method, ensures that the page exit and the entered animation are uniformly managed when the page is switched.
本发明实施例还公开了一种存储介质,该存储介质上存储有计算机程序,计算机程序被处理器执行时实现安卓***中启动页面的方法。The embodiment of the invention further discloses a storage medium on which a computer program is stored, and when the computer program is executed by the processor, a method for starting a page in the Android system is implemented.
本发明实施例还公开了一种电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,处理器执行计算机程序时实现安卓***中启动页面的方法。The embodiment of the invention further discloses an electronic device, comprising a memory and a processor, wherein the memory stores a computer program running on the processor, and the processor implements a method for starting a page in the Android system when the computer program is executed.
参见图2所示,本发明实施例还公开了一种安卓***中启动页面 的***,包括:Referring to FIG. 2, an embodiment of the present invention further discloses a system for starting a page in an Android system, including:
StartManager管理类模块,StartManager管理类模块包括startActivity方法,startActivity方法包括target对象和params对象;target对象用于获取并存储需启动的目标地址的类名,param对象用于获取并存储跳转需要的信息内容;The StartManager management class module, the StartManager management class module includes a startActivity method, the startActivity method includes a target object and a params object; the target object is used to acquire and store a class name of a target address to be started, and the param object is used to acquire and store information required for the jump. content;
intent对象模块,intent对象模块用于获取target对象中存储的需启动的目标地址的类名和param对象存储的跳转需要的信息内容;The intent object module, the intent object module is used to obtain the class name of the target address to be started stored in the target object and the information content required for the jump of the param object storage;
页面启动模块,页面启动模块用于启动安卓***context对象中的startActivity方法,向context对象中的startActivity方法传递intent对象,启动目标页面。The page startup module, the page startup module is used to start the startActivity method in the Android system context object, and the intent object is sent to the startActivity method in the context object to start the target page.
安卓***中启动页面的***还包括动画效果设置模块,动画效果设置模块用于在startActivity方法执行完成后,通过调用overridePendingTransition函数设置页面启动过程中的动画效果。The system for starting the page in the Android system further includes an animation effect setting module, and the animation effect setting module is used to set the animation effect during the page startup process by calling the overridePendingTransition function after the startActivity method is executed.
本发明不局限于上述实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围之内。本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。The present invention is not limited to the above embodiments, and those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. These improvements and retouchings are also considered as protection of the present invention. Within the scope. The contents not described in detail in the present specification belong to the prior art well known to those skilled in the art.
Claims (10)
- 一种安卓***中启动页面的方法,其特征在于,包括:A method for launching a page in an Android system, comprising:创建StartManager管理类,在StartManager管理类中定义startActivity方法,在startActivity方法中定义target对象和params对象;Create a StartManager management class, define the startActivity method in the StartManager management class, and define the target object and the params object in the startActivity method.通过target对象获取并存储需启动的目标地址的类名,通过param对象获取并存储跳转需要的信息内容;The class object of the target address to be started is obtained and stored by the target object, and the information content required for the jump is acquired and stored by the param object;创建intent对象,通过intent对象获取target对象中存储的需启动的目标地址的类名和param对象存储的跳转需要的信息内容;The intent object is created, and the intent object acquires the class name of the target address to be started stored in the target object and the information content required for the jump stored by the param object;启动安卓***context对象中的startActivity方法,向context对象中的startActivity方法传递intent对象,启动目标页面。Start the startActivity method in the Android context object, pass the intent object to the startActivity method in the context object, and start the target page.
- 如权利要求1所述的一种安卓***中启动页面的方法,其特征在于:所述target对象包括setClass函数和getClass函数;通过setclass函数存储需启动的目标地址的类名,通过getClass函数获取setclass函数存储的需启动的目标地址的类名并标记为targetClass。The method for starting a page in an Android system according to claim 1, wherein the target object includes a setClass function and a getClass function; a class name of a target address to be started is stored by a setclass function, and a set class is obtained by a getClass function. The class name of the target address to be started by the function store and marked as targetClass.
- 如权利要求2所述的一种安卓***中启动页面的方法,其特征在于:所述param对象包括put函数和get函数;通过put函数存储跳转需要的信息内容,通过get函数依次取出put函数中存储的跳转需要的信息内容。The method for starting a page in an Android system according to claim 2, wherein the param object comprises a put function and a get function; the put function is used to store the information content required for the jump, and the put function is sequentially taken out by the get function. The information content required for the jump stored in the store.
- 如权利要求3所述的一种安卓***中启动页面的方法,其特征在于:通过调用intent对象中的setClass函数将所述target对象中需启动的目标地址的类名设置到intent对象中;通过调用intent对象中的getBundle方法获取bundle对象,调用get函数依次取出put函数中存储的跳转需要的信息内容,通过调用bundle对象中的putString方法将所述param对象中的跳转需要的信息内容封装到bundle对象 中。The method for starting a page in an Android system according to claim 3, wherein the class name of the target address to be started in the target object is set to the intent object by calling the setClass function in the intent object; Call the getBundle method in the intent object to get the bundle object, call the get function to fetch the information content needed for the jump stored in the put function, and encapsulate the information content required by the jump in the param object by calling the putString method in the bundle object. Into the bundle object.
- 如权利要求1所述的一种基于安卓中的启动工具的实现方法,其特征在于:将param对象的类型设置为键值对类型,将param对象中的键及键值均设置为字符串类型。The method for implementing a startup tool based on Android according to claim 1, wherein the type of the param object is set to a key-value pair type, and the key and the key value in the param object are all set to a string type. .
- 如权利要求1所述的一种基于安卓中的启动工具的实现方法,其特征在于:在startActivity方法执行完成后,通过调用overridePendingTransition函数设置页面启动过程中的动画效果。The implementation method of the startup tool based on Android according to claim 1, wherein after the execution of the startActivity method is completed, the animation effect during the page startup process is set by calling the overridePendingTransition function.
- 一种存储介质,该存储介质上存储有计算机程序,其特征在于:所述计算机程序被处理器执行时实现权利要求1至6任一项所述的方法。A storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the method of any one of claims 1 to 6.
- 一种电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,其特征在于:处理器执行计算机程序时实现权利要求1至6任一项所述的方法。An electronic device comprising a memory and a processor, the memory having stored thereon a computer program running on the processor, wherein the processor executes the computer program to implement the method of any one of claims 1 to 6.
- 一种安卓***中启动页面的***,其特征在于,包括:A system for launching a page in an Android system, comprising:StartManager管理类模块,所述StartManager管理类模块包括startActivity方法,所述startActivity方法包括target对象和params对象;target对象用于获取并存储需启动的目标地址的类名,param对象用于获取并存储跳转需要的信息内容;The StartManager management class module, the StartManager management class module includes a startActivity method, the startActivity method includes a target object and a params object; the target object is used to acquire and store a class name of a target address to be started, and the param object is used to acquire and store the hop. Transfer the required information content;intent对象模块,所述intent对象模块用于获取target对象中存储的需启动的目标地址的类名和param对象存储的跳转需要的信息内容;An intent object module, the intent object module is configured to obtain a class name of a target address to be started stored in the target object and a information content required for a jump stored by the param object;页面启动模块,所述页面启动模块用于启动安卓***context对象中的startActivity方法,向context对象中的startActivity方法传递intent对象,启动目标页面。The page startup module is configured to start a startActivity method in an Android system context object, and send an intent object to a startActivity method in the context object to start a target page.
- 如权利要求9所述的一种安卓***中启动页面的***,其特 征在于:所述安卓***中启动页面的***还包括动画效果设置模块,所述动画效果设置模块用于在startActivity方法执行完成后,通过调用overridePendingTransition函数设置页面启动过程中的动画效果。The system for launching a page in an Android system according to claim 9, wherein the system for starting a page in the Android system further comprises an animation effect setting module, wherein the animation effect setting module is used to execute the startActivity method. After that, the animation effect during page startup is set by calling the overridePendingTransition function.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810019238.7 | 2018-01-09 | ||
CN201810019238.7A CN108334392B (en) | 2018-01-09 | 2018-01-09 | Start method, storage medium, equipment and the system of the page in Android system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019136843A1 true WO2019136843A1 (en) | 2019-07-18 |
Family
ID=62923250
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/081288 WO2019136843A1 (en) | 2018-01-09 | 2018-03-30 | Method, storage medium, device and system for starting page in android system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108334392B (en) |
WO (1) | WO2019136843A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109254858B (en) * | 2018-08-31 | 2021-07-23 | 武汉斗鱼网络科技有限公司 | Data sharing method, device and equipment of active window and storage medium |
CN109408057B (en) * | 2018-10-23 | 2022-03-04 | 网易传媒科技(北京)有限公司 | Method, device, medium and computing equipment for automatically generating codes |
CN109151591A (en) * | 2018-11-20 | 2019-01-04 | 四川长虹电器股份有限公司 | The method of smart television application starting |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105159712A (en) * | 2015-09-01 | 2015-12-16 | 北京金山安全软件有限公司 | Interface starting method and device |
CN105893061A (en) * | 2016-06-12 | 2016-08-24 | 杭州勒芒科技有限公司 | Application program development method and system |
CN107454956A (en) * | 2017-03-15 | 2017-12-08 | 深圳大趋智能科技有限公司 | Application program launching page loads the method, apparatus and terminal of animation |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103744669B (en) * | 2013-12-26 | 2017-07-18 | 世纪龙信息网络有限责任公司 | Establishment, call method and the system of Android system Activity plug-in units |
CN106708506A (en) * | 2016-11-17 | 2017-05-24 | 武汉斗鱼网络科技有限公司 | Method and device for optimizing starting speed of Android applications visually |
-
2018
- 2018-01-09 CN CN201810019238.7A patent/CN108334392B/en active Active
- 2018-03-30 WO PCT/CN2018/081288 patent/WO2019136843A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105159712A (en) * | 2015-09-01 | 2015-12-16 | 北京金山安全软件有限公司 | Interface starting method and device |
CN105893061A (en) * | 2016-06-12 | 2016-08-24 | 杭州勒芒科技有限公司 | Application program development method and system |
CN107454956A (en) * | 2017-03-15 | 2017-12-08 | 深圳大趋智能科技有限公司 | Application program launching page loads the method, apparatus and terminal of animation |
Also Published As
Publication number | Publication date |
---|---|
CN108334392B (en) | 2019-09-20 |
CN108334392A (en) | 2018-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020024408A1 (en) | Test device, test method and storage medium | |
WO2019136843A1 (en) | Method, storage medium, device and system for starting page in android system | |
JP4834566B2 (en) | Apparatus and method for forcibly terminating a thread blocked by I / O work | |
JP2012079130A (en) | Debug support program, debug support device and debug support method | |
US9910733B2 (en) | Transaction completion in a synchronous replication environment | |
WO2017000567A1 (en) | Bootrom upgrading method and device | |
CN113064604A (en) | Firmware upgrading method and device | |
JP6195465B2 (en) | Remote card content management using synchronous server-side scripting | |
TWI588742B (en) | Program codes loading method of application and computing system using the same | |
US9229724B2 (en) | Serializing wrapping trace buffer via a compare-and-swap instruction | |
JP2021508389A5 (en) | ||
KR20120027219A (en) | Capturing and loading operating system states | |
US10338891B2 (en) | Migration between model elements of different types in a modeling environment | |
JP4931711B2 (en) | Kernel update method, information processing apparatus, program, and storage medium | |
CA2707249C (en) | Native interface optimization for read-only arrays | |
CN109144524B (en) | Version release method of subject game on education platform and electronic equipment | |
JP6935694B2 (en) | Electronic control device | |
CN106598687B (en) | Script preheating method and device | |
JP5085562B2 (en) | External setting of processing contents for script | |
US9672083B2 (en) | Operating a program code object in conjunction with an application context | |
CN104937560B (en) | Method and apparatus for remote system debugging | |
CN110321132B (en) | Code release method and device | |
CN108255534B (en) | PC (personal computer) end application processing method, processing device, electronic equipment and storage medium | |
JP2020516990A5 (en) | ||
CN116541085B (en) | Android/Linux fusion method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18899349 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18899349 Country of ref document: EP Kind code of ref document: A1 |