English 中文(简体)
广播接收器显示的主题对话框活动
原标题:Theme.Dialog activity displayed from Broadcast Receiver
  • 时间:2011-06-01 08:20:10
  •  标签:
  • java
  • android

我使用Theme.Dialog活动在警报触发时向用户显示提醒,它有两个按钮OK和Skip,现在我希望用户在激活提醒并显示在屏幕上时按下其中任何一个按钮,以便生成报告。但是,如果用户错误地按下后退按钮或主页按钮,该活动将在后台进行,并且警报不断播放,我就无法将该活动重新放在前面。当该活动出现在设备屏幕上时,是否有任何方法可以禁用后退或主页按钮,或者有任何其他更好的选择来保持活动在前面,除非用户按下任何一个给定的按钮?

最佳回答

根据Android架构,你可以处理后退按钮,但不能处理主页,所以你可以做的是覆盖你活动的onPause()方法,并根据你的要求解除你的警报,保持活动在前面,除非你提供的某个按钮不可用

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签