You may try this on Android 4.0+:
1. Register a BroadcastReceiver for Intent.ACTION_CLOSE_SYSTEM_DIALOGS.
2. Call Intent.getStringExtra(“reason”) to get the reason. Reasons are below:
“homekey” for home key pressed;
“assist” for home key long pressed;
More Related Contents:
- Array of Buttons [closed]
- How can I use external JARs in an Android project?
- Android check internet connection [duplicate]
- What is the purpose of Looper and how to use it?
- RuntimeException: Unable to instantiate application
- Put constant text inside EditText which should be non-editable – Android
- Programmatically select item ListView in Android
- Android: Coloring part of a string using TextView.setText()?
- Geocoder.getFromLocation throws IOException on Android emulator
- Difference between apk (.apk) and app bundle (.aab)
- Disconnect a bluetooth socket in Android
- Custom cut/copy action bar for EditText that shows text selection handles
- ViewPager detect when user is trying to swipe out of bounds
- AlarmManager not working in several devices
- Receiver not registered exception error?
- TextInputLayout :How to give padding or margin to hint?
- How to get screen size of device? [duplicate]
- importing jar libraries into android-studio
- Picasso Library, Android: Using Error Listener
- HttpClient on Android : NoHttpResponseException through UMTS/3G
- Android – loop part of the code every 5 seconds
- How do I retrieve the logged in Google account on android phones?
- How to verify if user has network access and show a pop-up alert when there isn’t
- Zipalign – Command not found – MAC terminal
- Android: mkdirs()/mkdir() on external storage returns false
- Check if my application has usage access enabled
- Appcompat does not work
- What is the difference between onPause() and onStop() of Android Activites?
- How to switch from the default ConstraintLayout to RelativeLayout in Android Studio
- How do I get a copy of the Android overflow menu icon? [closed]