2

I'm developing an app that lives in the WindowManager but shouldn't cover other applications. I want it to appear only in the home screen.

I added the view easily to the WindowManager but I can't find out if I can set the view to live only in the home screen.

I know that I can get the top app like this and check if it different then "launcher" but it would have to run forever, and beside it an awful programming it also battery killer:

ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfo =
am.getRunningAppProcesses();
for (int i = 0; i < runningAppProcessInfo.size(); i++) {
    Log.v("Proc: ", runningAppProcessInfo.get(i).processName);
}
Dima Rostopira
  • 8,261
  • 3
  • 52
  • 74
Nativ
  • 3,009
  • 6
  • 33
  • 61

1 Answers1

1

@Nativ, You might consider using System Overlay, to have a view come on top. Creating a system overlay window (always on top)

Community
  • 1
  • 1
bond
  • 10,356
  • 6
  • 44
  • 60