开发者

How to receive the TIME_TICK intent

This isn't a very advanced question, I just don't understand how exactly to receive intents in Android. I want to update a clock app (only when it's in the foreground) every minute. I guess I have to create a class that extends BroadcastReceiver, and implement the method onReceive(Context cont开发者_运维百科ext, Intent intent), and add an intent filter in my AdroidManifest.xml? How do I add that filter? Is that the only thing that makes the intent received ACTION_TIME_TICK?


As Android SDK reference states, you have to explicitly register for this intent with:

Context.registerReceiver().
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜