Background technology
The Launcher abbreviation Home Screen of android system(Main interface), after being android system loaded
First application program of startup, it is responsible for all operations in addition to application operation itself, including several desktops, click application
Program icon start application program, it is long by desktop occur menu and dustbin, it is long by after application program can with shift position, can be with
Abundant Widget, arrangement is loaded to start the shortcut icon of application program and set wallpaper etc..So Launcher is Android
One very important application program of system, is the entrance of all application programs, be also system highly dependent upon a basis should
With program, when system has multiple Launcher, if user can with it is convenient and simple be switched to the Launcher for oneself liking when,
Can be with strengthening system Consumer's Experience.
The android system of ecosystem has a concept of acquiescence Launcher when starting Launcher, when system is installed
During multiple Launcher, when user clicks on the Home key on system UI navigation bars, first determine whether to give tacit consent to Launcher, such as
Fruit is not provided with giving tacit consent to Launcher, then pop-up dialogue box is selected for user, can select to set acquiescence Launcher, it is also possible to
Do not select to set acquiescence Launcher, and only select certain Launcher to start.If there is provided acquiescence Launcher, clicks
During Home key, then start acquiescence Launcher, no longer eject choice box and selected for user.If now user thinks switching
, it is necessary into the application program management under system setting, find current acquiescence Launcher during Launcher, remove acquiescence and set
Put data.So, when again tapping on Home key, Launcher dialog boxes can just be ejected and is selected for user.Removing acquiescence sets
Data method is put, very hidden and complexity, to some primary android system users, it is difficult to find the method, switches
It is inconvenient during Launcher;Meanwhile, the concept of acquiescence is also easy to obscure to some users, bad using bringing to user
Experience
Therefore, prior art has yet to be improved and developed.
The content of the invention
In view of above-mentioned the deficiencies in the prior art part, the present invention is the defect and deficiency of solution prior art, is proposed a kind of
The method and system of Launcher in android system can be realized being switched fast.
The technical proposal for solving the technical problem of the invention is as follows:
The method of main interface is switched fast in a kind of android system, is comprised the following steps:
The key-press event of acquisition system Home key;
Judge that the key-press event is click event or long by event;
When the key-press event is click event, window manager inquiry system whether there is multiple main interfaces, exist
During multiple main interfaces, system obtains and is the most recently used main interface and starts, and otherwise directly initiates main interface;
When the key-press event presses event for length, whether window manager inquiry system is multiple main interfaces, is existed many
During individual main interface, the main interface that system obtains multiple main interface information and chooses starts, and otherwise directly initiates main interface.
As a further improvement, the key-press event of the acquisition system Home key receives Home by input management services module
The key-press event of key.
Wherein, the system obtains and is the most recently used main interface and starts specific using following steps realization:
The nearest list of application of acquisition system;
Inquiry is the most recently used main interface from the nearest list of application;
The application package name of main interface is passed into campaign management services module, institute is started by campaign management services module
State and be the most recently used main interface.
Wherein, the main interface startup that the system obtains multiple main interface information and chooses specifically uses following steps
Realize:
The application information of multiple main interfaces that acquisition system is currently installed on;
Ejection main interface selection dialog box;
Choose one of main interface and the application package name of the main interface is passed into campaign management services module, by
Campaign management services module starts the main interface that this is chosen.
The main interface that directly initiates specifically passes to campaign management services mould using by the application package name of main interface
Block, main interface is started by campaign management services module.
The present invention also provides the system that main interface is switched fast in a kind of android system, and the system includes:Input pipe
Reason service module, Home key event judge module, window manager and campaign management services module;
The input management services module is used for the key-press event of reception system Home key;
The Home key event judge module be used to judging the input Home key that receives of management services module by
Key events are click event or long by event;
The window manager is used to be looked into when judging the key-press event of Home key according to the judgement Home key event module
Inquiry system whether there is multiple main interfaces, and when the key-press event is click event, acquisition is the most recently used main interface letter
Main interface information is ceased and sent to the campaign management services module, when the key-press event presses event for length, obtain multiple
Main interface information is selective concurrently send to be elected in main interface information give the campaign management services module;Otherwise select single main boundary
Face simultaneously sends the single main interface information to the campaign management services module;
The campaign management services module is used to receiving the main interface information that the window manager sends over and starts
The main interface.
As a further improvement, it is by acquisition system that the window manager acquisition is the most recently used main interface information
Nearest list of application simultaneously inquires from the nearest list of application and is the most recently used main interface information to realize.
It is the multiple master being currently installed on by acquisition system that the window manager obtains multiple main interface information selective
The application information at interface simultaneously ejects what main interface selected dialog box to realize.
The window manager is by by main interface when main interface information is sent into campaign management services module
Application package name passes to the completion of campaign management services module.
Compared with prior art, the inventive method carries out the switching of main interface according to the kind of event of Home key, when
The event of Home key first judges whether main interface has multiple when being click event, then starts when there is multiple main interfaces and uses recently
The main interface crossed shows;When the event of Home key when growing by event first to judge whether main interface has multiple, there are multiple main boundaries
Then pop-up dialogue box selects and selects the main interface that user chooses to start for user during face;In the case of two kinds of key-press events, work as master
During the only one of which of interface, then this main interface is directly initiated.And prior art needs in the case where there are multiple main interfaces
The setting of acquiescence main interface is determined whether, needs to enter system setup menu ability when user needs modification acquiescence main interface
Complete, and the present invention only needs to be clicked when user operates Home key or the change main interface by long, allows user
Quick switching main interface, avoids the operation that complicated acquiescence main interface is set, and improves user experience sense.
Specific embodiment
To make the objects, technical solutions and advantages of the present invention clearer, clear and definite, develop simultaneously embodiment pair referring to the drawings
The present invention is further described.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and without
It is of the invention in limiting.
Android system is installed on the operating system in mobile intelligent terminal equipment, intelligent terminal bag extensively at present
The equipment such as smart mobile phone, panel computer are included, can be by present invention side using the mobile intelligent terminal equipment of android system
Method and system realize being switched fast the purpose of main interface, and the preferred embodiment of the present invention carries out specifically by taking smart mobile phone as an example
It is bright.
As shown in figure 1, being switched fast the flow chart of the method preferred embodiment of main interface in a kind of android system, wrap
Include following steps:
S100, obtains the key-press event of system Home key.
The key-press event of the acquisition system Home key is received the key-press event of Home key by input management services module.With
Home key is often used at family when using smart mobile phone, and the inventive method embodiment is carried out by receiving the event of Home key
Switching service, when user presses Home key, management service mould is input into by the Input Manager Service of android system
Block receives user by the event for hitting Home key.
S200, judges that the key-press event is click event or long by event.
The input management services module of system judges that the key press time of user is click event or long by event, and will be by
Key events pass to the window manager of system, and window manager is specially mobile phone window manager in smart mobile phone(PWM,
Phone Window Manager).
S300, when the key-press event is click event, window manager inquiry system whether there is multiple main interfaces,
During in the presence of multiple main interfaces, system obtains and is the most recently used main interface and starts, and otherwise directly initiates main interface.
Receive input management services module pass over click key-press event after, window manager elder generation inquiry system in
With the presence or absence of multiple main interfaces, judgement is switched over according to one or more main interfaces, system meeting when there is multiple main interfaces
Automatic user is the most recently used main interface, allows users to rapidly enter most recently used main interface without switching,
In general most recently used main interface is user's frequency of use main interface higher, therefore, take in the presence of multiple main interfaces
In the case of be switched to the use habit that most recently used main interface meets user.When system only exists single main interface, window
Mouth manager then directly initiates the main interface of uniquely presence.
Wherein, the system obtains and is the most recently used main interface and starts specific using following steps realization:
1st, the nearest list of application of system is obtained;
2nd, inquiry is the most recently used main interface from the nearest list of application;
3rd, the application package name of main interface is passed into campaign management services module, is started by campaign management services module
It is described to be the most recently used main interface.
Wherein, the main interface that directly initiates specifically passes to activity management clothes using by the application package name of main interface
Business module, main interface is started by campaign management services module.
S400, when the key-press event presses event for length, whether window manager inquiry system is multiple main interfaces, is deposited
In multiple main interfaces, the main interface that system obtains multiple main interface information and chooses starts, and otherwise directly initiates main boundary
Face.
Receive input management services module pass over click key-press event after, window manager elder generation inquiry system in
With the presence or absence of multiple main interfaces, judgement is switched over according to one or more main interfaces, system is obtained when there is multiple main interfaces
Take the information of multiple main interfaces and be shown to user, user according to exist multiple main interfaces select oneself need main interface come
Start, provide the user a kind of mode of quick selection startup in the case of many main interfaces.It is that click event is the same with key-press event,
When system only exists single main interface, window manager then directly initiates the main interface of uniquely presence.
Wherein, the main interface startup that the system obtains multiple main interface information and chooses specifically uses following steps
Realize:
1st, the application information of multiple main interfaces that acquisition system is currently installed on;
2nd, ejection main interface selection dialog box;
3rd, one of main interface is chosen and by the application package of main interface name(It is in android system
Activity)Pass to campaign management services module(It is Activity Manager defined in android system
Service), the main interface chosen is started by campaign management services module.
Wherein, the main interface that directly initiates specifically passes to activity management clothes using by the application package name of main interface
Business module, main interface is started by campaign management services module.
So, user can be just switched fast by Home key to the main interface that oneself needs, and need not be entered
System is set goes modification acquiescence main interface to switch, and solves the problems, such as that main interface switching is complicated.
The present invention also provides the system that main interface is switched fast in a kind of android system, as shown in Fig. 2 the system bag
Include:Input management services module 10, Home key event judge module 20, window manager 30 and campaign management services module 40;
The input management services module 10 is used for the key-press event of reception system Home key;
The Home key event judge module 20 is used to judge the Home key that the input management services module is received
Key-press event is click event or long by event;
When the window manager 30 is used to judge the key-press event of Home key according to the judgement Home key event module
Inquiry system whether there is multiple main interfaces, and when the key-press event is click event, acquisition is the most recently used main interface
Information simultaneously sends main interface information to the campaign management services module, when the key-press event presses event for length, obtains many
Individual main interface information is selective concurrently send to be elected in main interface information give the campaign management services module;Otherwise select single master
Interface simultaneously sends the single main interface information to the campaign management services module;
The campaign management services module 40 is used to receiving the main interface information that the window manager sends over and opens
Move the main interface.
Wherein, the window manager 30 is obtained and is the most recently used main interface information is applied recently by acquisition system
List simultaneously inquires from the nearest list of application and is the most recently used main interface information to realize.
It is the multiple being currently installed on by acquisition system that the window manager 30 obtains multiple main interface information selective
The application information of main interface simultaneously ejects what main interface selected dialog box to realize.
The window manager 30 is by by main interface when main interface information is sent into campaign management services module
Application package name pass to campaign management services module completion.
The operation principle of present system preferred embodiment is identical with above method preferred embodiment, and specific work process can
Reference method embodiment, does not repeat herein.
It should be appreciated that the foregoing is only presently preferred embodiments of the present invention, limitation is e insufficient to of the invention
Technical scheme, for those of ordinary skills, within the spirit and principles in the present invention, can add according to the above description
To increase and decrease, replace, convert or improve, and the technical scheme after all these increases and decreases, replacement, conversion or improvement, should all belong to this
The protection domain of invention appended claims.