Frage

I want to check whether user is facing the widget Homescreen(ie where the widget are placed) or using some other screen .ie he may be playing game or texting or something else..If user is on some other screen i don't want execute my code..

For instance a clock widget doesn’t need to run once a minute if it’s not visible on the screen. In order to cut down on battery drain it would be really nice if home screen widgets could be informed of their visibility

War es hilfreich?

Lösung

This is not possible in any reliable fashion. There is a long-standing issue to provide some ability to do this.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top