如何检查小部件主屏幕 [英] How to check for widget Home screen

查看:190
本文介绍了如何检查小部件主屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要检查用户是否正对着主屏幕小部件(即那里的小部件被放置),或使用其他一些屏幕.IE他可能会被玩游戏或发短信什么的else..If用户是一些其他的屏幕上我不不想执行我的code ..

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

推荐答案

这是不可能的任何可靠的方式。有一个长期存在的问题提供一些能够做到这一点。

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

这篇关于如何检查小部件主屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆