0

How we get current window access Without activity? i have a service and i want to get current window screen object. any body know how we will get??

sysbrightness = android.provider.Settings.System.getInt(cr,
android.provider.Settings.System.SCREEN_BRIGHTNESS);
lpnew.screenBrightness = sysbrightness;                     
win.setAttributes(lpnew);

Note: i have not any activity,just i have service and want to get
current window.
Android007
  • 121
  • 1
  • 1
  • 10
  • 2
    I think there is no way to get current window without access to activity. 99.99% sure.. – Kartik Domadiya Nov 03 '11 at 07:34
  • Just to think the other way around: do you want an arbitrary background service access the current foreground activity, e.g. your browser while you are entering an online banking transaction? – sstn Nov 03 '11 at 13:38

1 Answers1

2

This is not possible, sorry. Only activities can access Window objects.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491