Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top