开发者

Theme.Dialog activity displayed from Broadcast Receiver

I am us开发者_如何学Going Theme.Dialog activity to display user a reminder whenever Alarm triggers, It has two buttons OK and Skip, now I want user to press any one of these buttons whenever this reminder activated and displayed on screen, so that reports can be generated. But If user mistakenly presses the back button or Home button that activity goes in the background and alarm keeps playing and there is no way for me to bring that activity back in front. Is there any way to disable the back or home button when this activity is on device's screen or any other better alternative to keep the activity in front unless user presses any one of the given buttons?


As per Android architecture you can handle back button but not Home so what you can do is override the onPause() method of you activity and dismiss your alarm there, as per your requirement to keep the activity in front unless one of the button you supplied is not used is not possible

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜