开发者

Bring your custom Activity get launched at in fixed time duration

开发者 https://www.devze.com 2023-02-06 01:18 出处:网络
I want to keep my 开发者_如何转开发activity on TOP always. I need to get my Activity called to TOP in every 5 sec.( not re-create).

I want to keep my 开发者_如何转开发activity on TOP always.

I need to get my Activity called to TOP in every 5 sec.( not re-create). I used Timer, but not able to do so.

Please help me. If possible provide some code also.


I don't like the idea of forcing an opening of an Activity. It will get uninstalled from my phone and reported in the market :).

To do that you will need to use BroadCastReceiver and the AlarmManager.

The idea is to set an alarm with the AlarmManager and when it's fired your BroadCastReceiver will use context.startActivity(); to start your Activity.

Don't forget to make your BroadCastReceiver listen for android.intent.action.BOOT_COMPLETED. This way you can bother the user after the booting finishes :)

0

精彩评论

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