0

I’m trying to execute custom code that is invoked from a listprefeence radio box elsewhere in the setting UI. Its code that will allow the user to select different styles of battery icons on their phone on the fly without a reboot. I have everything done and the code executes fine with one exception. It takes 10-12 seconds for the change to take place. Kind of like it’s not executing until the system does its own check on battery status. How to I get it to execute immediately upon checking the box? Is this done through the use of a broadcast receiver? I am trying to learn android development and have become pretty good with smali but not so much with actual Java yet. I know it’s backwards but I’m trying….

Any help would be appreciated!

Thanks, Jimmie

4

1 回答 1

0

不完全是广播接收器,您想要的是找出检查电池状态的系统服务。一旦在 UI 上收到用户请求,您就可以调用系统服务来检查电池状态并随后更改图标。

此外,您正在寻找的系统服务可能不一定是电池状态检查服务,它可能是 UI 更新程序或其他一些在超时后运行并反映您的更改的更新程序服务。

因此,您需要弄清楚哪个系统服务反映了您的更改,然后在用户更改了他的偏好后手动调用该系统服务。

于 2013-01-28T19:25:42.387 回答