GoSms 从alertDialog 中窃取焦点
我有一个收到消息时弹出的警报对话框。只要 goSms 不干扰,它就可以正常工作。当使用 goSms 启用弹出选项时,我的警报会弹出,但位于 go sms 弹出窗口后面,并且 goSms 弹出窗口是透明的。在我的警报获得焦点并实际记录触摸之前,我必须点击关闭按钮几次。
final AlertDialog d = new AlertDialog.Builder(ctx)
.setTitle(title)
.setMessage(message)
.setCancelable(false)
.setIcon(R.drawable.ic_alert)
.setPositiveButton("Dismiss", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//finish();
dialog.dismiss();
}
})
.create();
d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
如何让我的alertDialog在创建时获得焦点?
I have an alertDialog that pops up when a message is received. It works fine, as long as goSms doesnt interfere. When the popup option is enabled with goSms, my alert pops up, but behind the go sms popup, and the goSms popup is transparent. I have to tap the dismiss button a few times before my alert obtains focus and actually registers the touch.
final AlertDialog d = new AlertDialog.Builder(ctx)
.setTitle(title)
.setMessage(message)
.setCancelable(false)
.setIcon(R.drawable.ic_alert)
.setPositiveButton("Dismiss", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//finish();
dialog.dismiss();
}
})
.create();
d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
How can I get my alertDialog to pull focus when its created?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试为应用程序的广播接收器提供非常高的优先级。
<意图过滤器 android:icon="可绘制资源"
android:label="字符串资源"
android:priority="HIGH_VALUE_INTEGER" >
。 。 .
< /intent-filter>
需要理解的是,具有高优先级的人将首先访问该通知。
有关此的更多信息:
http://developer.android.com/guide/topics/manifest/intent-filter-element.html
http://developer.android.com/reference/android/content/BroadcastReceiver.html
you can try to give a very high valu of priority to your broadcast receiver of your app.
< intent-filter android:icon="drawable resource"
android:label="string resource"
android:priority="HIGH_VALUE_INTEGER" >
. . .
< /intent-filter>
Thing to understand is that one with the high priority will get access to that notification first.
More infor regarding this :
http://developer.android.com/guide/topics/manifest/intent-filter-element.html
http://developer.android.com/reference/android/content/BroadcastReceiver.html