1

I want to prevent to launch google if user long press home button.

enter image description here

How to disable this google launcher?

Community
  • 1
  • 1
Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74

1 Answers1

2
ActivityManager activityManager = (ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
activityManager.moveTaskToFront(getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);

This will not disable Home button long press but, will keep your task front always so, even you open any other app from your application it will be in background. this need permission android.permission.REORDER_TASKS

Srikanth
  • 1,555
  • 12
  • 20