Android mobile guard-home interface layout, android-home
This article implements a progressive fade-in animation effect when you enter the hone interface from the splash interface. The Code is as follows:
/*** Add a light animation effect */private void initAnimation () {AlphaAnimation alphaAnimation = new AlphaAnimati
Blog and git of well-known Android Developers at home and abroad, and androidgit at Home and Abroad
China:
Nickname
Github
Blog
Introduction
Deng fanping
Http://blog.csdn.net/innost
Arafnong
Wei zhulin
Http://blog.csdn.net/android_tutor
Trinea
Https://github.com/trinea
Http://www.trinea.c
You can disable the Home key first, then process the key value in onkeydown, and click
ProgramClose or DIY it with you.
CopyCodeThe Code is as follows: @ override
Public Boolean onkeydown (INT keycode, keyevent event ){
If (keyevent. keycode_home = keycode)
Android. OS. process. killprocess (Android. OS. process. mypid ());
Return super. onkeydown (keycode,
For the convenience of novice, although very simple, but I see no one in the park to write ... So just ... (I am also a novice ~)is actually using the activity stack principle ....Written in Mainactivity's Oncreat ():Notificationmanager Notificationmanager =(Notificationmanager) Getsystemservice (Context.notification_service); Notification Notification=NewNotification (R.drawable.ic_launcher,"hello,there!", System.currenttimemillis ()); Notification.flags=Notification.flag_auto_cancel;Intent Int
Android-mobile phone home location and landline home location query
During the development of the Android project, there was a need to query the mobile phone and landline locations. However, Android itself did not find a database that provides the query locations, therefore,
(reason.equalsignorecase ("HomeKey")) {///////To Mask Home key//Do some of your own actions here, such as re-opening your lock screen program interface, It's not going to go away. System.out.println ("Home key is triggered");} else if (reason.equalsignorecase ("Recentapps")) {//Shielded Home key Long press method System.out.println ("
Imitating the android QQ space today, the effect is as follows:
Open the startup screen and navigation page of the program and I will not do it. You can do it as easily as you can. This time, we mainly implement the Home Page. The layout of the home page is as follows:
Copy codeThe Code is as follows: Android: layout_
From http://www.eoeandroid.com/thread-109270-1-1.html
You have read many articles about the general method to block the Home key. To sum up, let's first talk about the screen button and Home Key of the activity.
Shield other keys and override onkeydown
Java code:
@ Override
Public Boolean onkeydown (INT keycode, keyevent event ){
Log. I (TAG, "keycode =" + keycode + "isban =" + isban );
Switch (keycod
Android Home Key MonitorAndroid Normal key value can be processed directly in dispatchkeyevent (), but the home key, more special, need to monitor its broadcast separately, and must be dynamic broadcast, its static broadcast is invalid;Requirements: Home key, set Kill yourself, but there are multiple activity in the Ac
In Android Application Development, we do not want users to directly press the back key to exit the activity, but hide the application to the background, similar to pressing the Home Key.
Provided belowCodeFor more information, see.
Public Boolean onkeydown (INT keycode, keyevent event) {If (keycode = keyevent. keycode_back) {intent = new intent (intent. action_main); intent. setflags (intent. flag_ac
The example in this article describes how Android programming simulates the Home key feature. Share to everyone for your reference, specific as follows:
Do a similar to QQ press the return key does not destroy the activity method (that is, do not call Activity.finish (), the system does not call OnDestroy), but is similar to pressing the home key, let the activi
This example analyzes the difference between the home and back keys in Android. Share to everyone for your reference. Specifically as follows:
Back key
Android programs do not need to quit deliberately, when you press the phone's Back button, the system will call the top activity in the stack Destroy () method to destroy the current activity, When the activity
One: The difference between the home key monitor and the back key monitor in Android:
(1). In Android, when the home key is pressed, by default the activity of the stop foreground, that is, the activity is set to stop State "onStop ()" Instead of destroying the State "ondestory ()". If you start the activity again, in
This example analyzes the way Android listens on the home key. Share to everyone for your reference, specific as follows:
How do I know if the home button is clicked? When doing launcher, look at the source code to find out why
If your activity has these attributes
When the system clicks the Home button
Android listens to Home key messages through Intent. ACTION_CLOSE_SYSTEM_DIALOGS
Android processes messages with four buttons at the bottom of the screen differently:
1. The search button message is received in onKeyDown or onKeyUp;
2. The menu button message is received in the onCreateOptionsMenu, onKeyDown, or onKeyUp method;
3. messages that return keys can be
Android Home Key listener and androidhome listenerAndroid Back Home key listener
Back key listening
It is easier to listen for the Back key. It can be intercepted in multiple system callbacks, for example, inIn the following methods of activity, you can receive the event of the Back key press.:
@ Override public void onBackPressed () {// super. onBackPressed ();
The approach is to fragment+fragmenttabhost components to achieve this common app home page effect
First give the Main.xml file
main code:
public class Mainactivity {@ViewInject (Android).
R.id.tabhost) Private Fragmenttabhost mtabhost;
Private Layoutinflater Layoutinflater; private int mimageviewarray[] = {R.DRAWABLE.HOME_TAB1, r.drawable.home_tab2, R.DRAWABLE.HOME_TAB3, R.drawab
software architecture is based on dual-system architecture.Basic: googletv Android system + DTV system. DTV systems are developed by TV system manufacturers and generally choose to reuse existing DTV systems. The googletv system module focuses on WebTV functions and adds control modules for communication with DTV systems.
Although Google TV is based on Android, Google has made a lot of TV applicationsUsed
1760 reading comments (13)FavoritesReport
This is an android study note about the home key.Proposal of proposal
The android HOME key system is responsible for monitoring and automatically processes the captured data. Sometimes, the processing of the system often does not mean anything. What should we do if we want to h
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.