Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event)
- {
- super.onKeyDown(keyCode, event);
- switch(keyCode)
- {
- case KeyEvent.KEYCODE_HOME:
- mHomeCheckbox.setChecked(true);
- ButtonsList[3] = 1;
- return true;
- }
- return false;
- }
- public boolean isApplicationSentToBackground(final Context context)
- {
- ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
- List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(1);
- if (!tasks.isEmpty())
- {
- mHomeCheckbox.setChecked(true);
- ButtonsList[3] = 1;
- return true;
- }
- return false;
- }
- @Override
- protected void onPause()
- {
- if (isApplicationSentToBackground(this))
- {
- }
- super.onPause();
- }
- @Override
- protected void onStop()
- {
- if (isApplicationSentToBackground(this))
- {
- }
- super.onStop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement