久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

    1. <i id='zSLC6'><tr id='zSLC6'><dt id='zSLC6'><q id='zSLC6'><span id='zSLC6'><b id='zSLC6'><form id='zSLC6'><ins id='zSLC6'></ins><ul id='zSLC6'></ul><sub id='zSLC6'></sub></form><legend id='zSLC6'></legend><bdo id='zSLC6'><pre id='zSLC6'><center id='zSLC6'></center></pre></bdo></b><th id='zSLC6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zSLC6'><tfoot id='zSLC6'></tfoot><dl id='zSLC6'><fieldset id='zSLC6'></fieldset></dl></div>
      <legend id='zSLC6'><style id='zSLC6'><dir id='zSLC6'><q id='zSLC6'></q></dir></style></legend>

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

    2. AlertDialog.show 在服務中被忽略

      AlertDialog.show silently ignored within a service(AlertDialog.show 在服務中被忽略)

        <legend id='B2f9K'><style id='B2f9K'><dir id='B2f9K'><q id='B2f9K'></q></dir></style></legend>
          <tbody id='B2f9K'></tbody>

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

          <tfoot id='B2f9K'></tfoot>
            <bdo id='B2f9K'></bdo><ul id='B2f9K'></ul>
              <i id='B2f9K'><tr id='B2f9K'><dt id='B2f9K'><q id='B2f9K'><span id='B2f9K'><b id='B2f9K'><form id='B2f9K'><ins id='B2f9K'></ins><ul id='B2f9K'></ul><sub id='B2f9K'></sub></form><legend id='B2f9K'></legend><bdo id='B2f9K'><pre id='B2f9K'><center id='B2f9K'></center></pre></bdo></b><th id='B2f9K'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='B2f9K'><tfoot id='B2f9K'></tfoot><dl id='B2f9K'><fieldset id='B2f9K'></fieldset></dl></div>
              • 本文介紹了AlertDialog.show 在服務中被忽略的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一個運行后臺線程的服務.我想做的是顯示從我的后臺線程啟動的 AlertDialog.我知道這不是通知用戶的推薦方式,并且它中斷工作流程(因為它們可以隨時在任何應用程序中彈出時間),但它適合我的用例.

                I have a service running a background thread. What I'd like to do is to show an AlertDialog initiated from my background thread. I know that this is not the recommended way of notifying the user and that it interrupts the workflow (as they can pop-up in any application at any time) but it's a suitable way for my use case.

                有一個處理程序注冊到后臺線程并顯示一個帶有處理程序的 Toast 通知工作正常.但是切換后到 AlertDialog 什么也沒有發生.我的 showDialog 邏輯是默默無視.沒有對話窗口出現,沒有日志條目.有點奇怪,因為我希望至少有一個日志條目說我正在做有什么不對或什么的.

                There is a handler registered with the background thread and showing a Toast notification withing the handler works fine. But after switching to an AlertDialog nothing happens anymore. My showDialog logic is silently ignored. No Dialog window appears, no log entry. It's a bit strange as I'd expect at least a log entry saying that I'm doing something wrong or whatever.

                顯示從服務后臺線程?有些人似乎推薦一個Dialog主題Activity 以獲得類似的行為.

                Are there any limitations for showing an AlertDialog initiated from a service background thread? Some people seem to recommend a Dialog themed Activity to get a similar behavior.

                非常感謝任何澄清或幫助使其工作!

                Any clarification or help making it work is greatly appreciated!

                伊夫

                推薦答案

                可以從后臺線程打開對話框.訣竅是啟動一個看起來像對話框的活動:

                It is possible to open a dialog from a background thread. The trick is to start an activity which looks like a dialog:

                <activity android:label="@string/app_name" android:name="YourDialog" android:theme="@android:style/Theme.Dialog"/>
                

                然后,開始您的活動:

                Intent dialog = new Intent(this, YourDialog.class);
                dialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(dialog);
                

                請注意,這是異步的,不會阻塞.如果要處理結果,則必須使用 startService() 并傳遞自定義活動來指示結果.

                Note that this is asyncrhonous and doesn't block. If you want to process the result, you'll have to use startService() and pass a custom activity to indicate a result.

                伊曼紐爾

                這篇關于AlertDialog.show 在服務中被忽略的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                Get current location during app launch(在應用啟動期間獲取當前位置)
                locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                  • <bdo id='33QzC'></bdo><ul id='33QzC'></ul>
                        <tbody id='33QzC'></tbody>
                      • <small id='33QzC'></small><noframes id='33QzC'>

                        <i id='33QzC'><tr id='33QzC'><dt id='33QzC'><q id='33QzC'><span id='33QzC'><b id='33QzC'><form id='33QzC'><ins id='33QzC'></ins><ul id='33QzC'></ul><sub id='33QzC'></sub></form><legend id='33QzC'></legend><bdo id='33QzC'><pre id='33QzC'><center id='33QzC'></center></pre></bdo></b><th id='33QzC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='33QzC'><tfoot id='33QzC'></tfoot><dl id='33QzC'><fieldset id='33QzC'></fieldset></dl></div>
                        • <tfoot id='33QzC'></tfoot>
                          <legend id='33QzC'><style id='33QzC'><dir id='33QzC'><q id='33QzC'></q></dir></style></legend>
                          主站蜘蛛池模板: 精品一级毛片 | 久草免费福利 | 91.xxx.高清在线 | 成人免费视频 | 亚洲精品一区二区三区 | 欧美日韩精品一区 | 91在线网站 | 久久久久午夜 | 插插宗合网| 看真人视频一级毛片 | 久久久久免费观看 | 精品国产乱码久久久久久影片 | 特级特黄特色的免费大片 | 国产精品久久久久一区二区三区 | 青青草社区 | 国外激情av | 日本久久视频 | 99久久久无码国产精品 | 亚洲超碰在线观看 | 国产乱码久久久久久一区二区 | 色婷婷综合久久久中字幕精品久久 | 在线免费观看黄色网址 | 91热爆在线观看 | 艹逼网 | 亚洲精品成人免费 | 巨大黑人极品videos精品 | 久久国产精品免费 | 欧美成人a∨高清免费观看 91伊人 | 欧美高清一区 | 国产精品91视频 | 草久久久 | 亚洲欧美日韩系列 | 一级看片免费视频 | 国产精品电影网 | 成人自拍av | 成人在线免费观看视频 | 久草资源在线视频 | 国产九九精品 | 国产精品18久久久久久久 | 色偷偷人人澡人人爽人人模 | 毛片免费在线观看 |