首页>
外国专利>
METHOD AND APPARATUS FOR SHARING SERVICE LOGIC BETWEEN LANDSCAPE MODE AND PORTRAIT MODE IN ANDROID SYSTEM
METHOD AND APPARATUS FOR SHARING SERVICE LOGIC BETWEEN LANDSCAPE MODE AND PORTRAIT MODE IN ANDROID SYSTEM
展开▼
机译:在安卓系统中景观模式和肖像模式之间共享服务逻辑的方法和装置
展开▼
页面导航
摘要
著录项
相似文献
摘要
A method and apparatus for sharing service logic between a landscape mode and a portrait mode in an Android system. The method comprises: defining a service log class for the same service logic between a landscape mode and a portrait mode, wherein a performance function corresponding to the same service logic between the landscape mode and the portrait mode is stored in the service logic class (S1); according to different service logic between the landscape mode and the portrait mode, defining a first service class of the landscape mode and a second service class of the portrait mode, and instantiating the service logic class in a construction function of the first service class and a construction function of the second service class (S2); and transferring an event function onTouchEvent, called back to a landscape or portrait interface by an Android system, to an instantiated object of the service logic class, so that the instantiated object of the service logic class calls a corresponding performance function to process the event object (S3). By bridging a function shared by a landscape service logic and a portrait service logic to a customized service logic class, the method realizes the aim of service sharing, and greatly reduces the redundancy of codes and improves the efficiency of development.
展开▼