• <i id='7AnQP'><tr id='7AnQP'><dt id='7AnQP'><q id='7AnQP'><span id='7AnQP'><b id='7AnQP'><form id='7AnQP'><ins id='7AnQP'></ins><ul id='7AnQP'></ul><sub id='7AnQP'></sub></form><legend id='7AnQP'></legend><bdo id='7AnQP'><pre id='7AnQP'><center id='7AnQP'></center></pre></bdo></b><th id='7AnQP'></th></span></q></dt></tr></i><div id='7AnQP'><tfoot id='7AnQP'></tfoot><dl id='7AnQP'><fieldset id='7AnQP'></fieldset></dl></div>
  • <legend id='7AnQP'><style id='7AnQP'><dir id='7AnQP'><q id='7AnQP'></q></dir></style></legend>

      • <bdo id='7AnQP'></bdo><ul id='7AnQP'></ul>
      1. <small id='7AnQP'></small><noframes id='7AnQP'>

        <tfoot id='7AnQP'></tfoot>
      2. BroadcastReceiver onReceive 打开对话框

        时间:2023-08-29

        <small id='j87S6'></small><noframes id='j87S6'>

          1. <legend id='j87S6'><style id='j87S6'><dir id='j87S6'><q id='j87S6'></q></dir></style></legend>
                <tbody id='j87S6'></tbody>

            • <i id='j87S6'><tr id='j87S6'><dt id='j87S6'><q id='j87S6'><span id='j87S6'><b id='j87S6'><form id='j87S6'><ins id='j87S6'></ins><ul id='j87S6'></ul><sub id='j87S6'></sub></form><legend id='j87S6'></legend><bdo id='j87S6'><pre id='j87S6'><center id='j87S6'></center></pre></bdo></b><th id='j87S6'></th></span></q></dt></tr></i><div id='j87S6'><tfoot id='j87S6'></tfoot><dl id='j87S6'><fieldset id='j87S6'></fieldset></dl></div>

              <tfoot id='j87S6'></tfoot>
                <bdo id='j87S6'></bdo><ul id='j87S6'></ul>

                • 本文介绍了BroadcastReceiver onReceive 打开对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在使用 BroadcastReceiver 构建一个 android 应用程序,并且我想在 onReceive 启动时显示一个对话框.我想在手机上显示对话框(无论用户身在何处,都向用户显示对话框,例如收到消息时的 whatsapp 对话框).

                  I'm building an android application with BroadcastReceiver and I want to show a dialog when onReceive starts. I want to show the dialog on the phone (show the user a dialog no matter where he is, like the whatsapp dialog when you get a message).

                  我该怎么做?

                  谢谢!

                  推荐答案

                  如果你想在广播接收器的 onReceive 内部显示一个对话框,你可以在广播接收器内部启动一个透明的活动一个警告对话框,从不调用 setContentView().该活动将具有透明视图,并且只会显示警报对话框.来源: 显示系统重启后广播接收器中的警报对话框

                  If you want to show a dialog from inside your onReceive of the BroadcastReceiver, inside your broadcast receiver you may start a transparent activity with an alert dialog and NEVER called setContentView(). The activity will have an transparent view and only the alert dialog will show. Source: show an alert dialog in broadcast receiver after a system reboot

                  有很多类似的帖子都在谈论这个话题.有关代码示例和其他评论,请参阅以下问题:

                  There are many similar posts which talk about this topic. See below questions for code samples and other reviews on the same:

                  1. BroadcastReceiver 中的 AlertDialog??能做到吗?

                  如何从 BroadcastReceiver 发出警报对话框上课?

                  如何显示来自 Android 广播接收器的对话框?

                  如何从 BroadcastReceiver 设置 Alertbox

                  希望这会有所帮助.

                  这篇关于BroadcastReceiver onReceive 打开对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Crashlytics 在崩溃后显示对话框? 下一篇:Android 图像对话框/弹出窗口

                  相关文章

                  最新文章

                • <tfoot id='T9DhY'></tfoot>
                  • <bdo id='T9DhY'></bdo><ul id='T9DhY'></ul>

                  <small id='T9DhY'></small><noframes id='T9DhY'>

                    <legend id='T9DhY'><style id='T9DhY'><dir id='T9DhY'><q id='T9DhY'></q></dir></style></legend>

                    <i id='T9DhY'><tr id='T9DhY'><dt id='T9DhY'><q id='T9DhY'><span id='T9DhY'><b id='T9DhY'><form id='T9DhY'><ins id='T9DhY'></ins><ul id='T9DhY'></ul><sub id='T9DhY'></sub></form><legend id='T9DhY'></legend><bdo id='T9DhY'><pre id='T9DhY'><center id='T9DhY'></center></pre></bdo></b><th id='T9DhY'></th></span></q></dt></tr></i><div id='T9DhY'><tfoot id='T9DhY'></tfoot><dl id='T9DhY'><fieldset id='T9DhY'></fieldset></dl></div>