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

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

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

      1. <small id='AdPuK'></small><noframes id='AdPuK'>

          <bdo id='AdPuK'></bdo><ul id='AdPuK'></ul>

        最簡單的是/否對話框片段

        Simplest yes/no dialog fragment(最簡單的是/否對話框片段)

        <small id='6jwOX'></small><noframes id='6jwOX'>

      2. <legend id='6jwOX'><style id='6jwOX'><dir id='6jwOX'><q id='6jwOX'></q></dir></style></legend>
          <bdo id='6jwOX'></bdo><ul id='6jwOX'></ul>

          <tfoot id='6jwOX'></tfoot>

              <tbody id='6jwOX'></tbody>
                <i id='6jwOX'><tr id='6jwOX'><dt id='6jwOX'><q id='6jwOX'><span id='6jwOX'><b id='6jwOX'><form id='6jwOX'><ins id='6jwOX'></ins><ul id='6jwOX'></ul><sub id='6jwOX'></sub></form><legend id='6jwOX'></legend><bdo id='6jwOX'><pre id='6jwOX'><center id='6jwOX'></center></pre></bdo></b><th id='6jwOX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6jwOX'><tfoot id='6jwOX'></tfoot><dl id='6jwOX'><fieldset id='6jwOX'></fieldset></dl></div>
                  本文介紹了最簡單的是/否對話框片段的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想制作一個對話片段,詢問你確定嗎?"回復是/否".

                  I'd like to make a dialog fragment that asks "Are you sure?" with a "yes/no" reply.

                  我查看了文檔,它真的很冗長,到處都是這個地方,解釋了如何制作高級對話框,但沒有完整的代碼來制作一個簡單的hello world"類型的對話框.大多數教程使用已棄用的對話框系統.官方博客似乎過于復雜且難以理解.

                  I've looked at the documentation and it's really verbose, going all over the place, explaining how to make advanced dialog boxes, but no intact code on making a simple 'hello world' kind of dialog box. Most tutorials utilize the deprecated dialog box system. The official blog seems to be unnecessarily complicated and difficult to understand.

                  那么,創建和顯示一個真正基本的警報對話框的最簡單方法是什么?使用支持庫的獎勵積分.

                  So, what's the simplest way to create and display a really basic Alert Dialog? Bonus points if it's using the support library.

                  推薦答案

                  DialogFragment 其實就是一個包裝了對話框的片段.您可以通過在 DialogFragment 的 onCreateDialog() 方法中創建并返回對話框來將任何類型的對話框放入其中.

                  A DialogFragment is really just a fragment that wraps a dialog. You can put any kind of dialog in there by creating and returning the dialog in the onCreateDialog() method of the DialogFragment.

                  這是一個示例 DialogFragment:

                  Heres an example DialogFragment:

                  class MyDialogFragment extends DialogFragment{
                      Context mContext;
                      public MyDialogFragment() {
                          mContext = getActivity();
                      }
                      @Override
                      public Dialog onCreateDialog(Bundle savedInstanceState) {
                          AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mContext);
                          alertDialogBuilder.setTitle("Really?");
                          alertDialogBuilder.setMessage("Are you sure?");
                          //null should be your on click listener
                          alertDialogBuilder.setPositiveButton("OK", null);
                          alertDialogBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                  
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  dialog.dismiss();
                              }
                          });
                  
                  
                          return alertDialogBuilder.create();
                      }
                  }
                  

                  創建對話調用:

                  new MyDialogFragment().show(getFragmentManager(), "MyDialog");
                  

                  并從某處關閉對話框:

                  ((MyDialogFragment)getFragmentManager().findFragmentByTag("MyDialog")).getDialog().dismiss();
                  

                  只需更改導入以使用支持庫類,所有這些代碼都將與支持庫完美配合.

                  All of that code will work perfectly with the support library, by just changing the imports to use the support library classes.

                  這篇關于最簡單的是/否對話框片段的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='7sgb2'></bdo><ul id='7sgb2'></ul>
                      <i id='7sgb2'><tr id='7sgb2'><dt id='7sgb2'><q id='7sgb2'><span id='7sgb2'><b id='7sgb2'><form id='7sgb2'><ins id='7sgb2'></ins><ul id='7sgb2'></ul><sub id='7sgb2'></sub></form><legend id='7sgb2'></legend><bdo id='7sgb2'><pre id='7sgb2'><center id='7sgb2'></center></pre></bdo></b><th id='7sgb2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7sgb2'><tfoot id='7sgb2'></tfoot><dl id='7sgb2'><fieldset id='7sgb2'></fieldset></dl></div>

                            <small id='7sgb2'></small><noframes id='7sgb2'>

                              <tbody id='7sgb2'></tbody>
                            <legend id='7sgb2'><style id='7sgb2'><dir id='7sgb2'><q id='7sgb2'></q></dir></style></legend>
                            <tfoot id='7sgb2'></tfoot>
                            主站蜘蛛池模板: 欧美日韩国产一区二区 | 亚洲视频免费在线观看 | 国产91在线播放精品91 | 久久在线精品 | 综合久久av | 国产福利在线视频 | 全免费a级毛片免费看视频免 | 久久高清 | 成人精品一区二区三区 | 成人深夜福利 | 精品在线一区二区 | 超碰在线播 | 九九久久在线看 | 一区二区日韩精品 | 国产在线永久免费 | 狠狠狠干 | 亚洲网在线 | 麻豆视频在线免费看 | 一区在线视频 | 欧美精品一二三 | 天天干天天谢 | av手机免费在线观看 | 欧美日韩中文在线 | 粉嫩av| 久久不卡 | 国产精品不卡一区 | 一级a毛片| 亚洲狠狠爱一区二区三区 | 亚洲一区二区三区四区五区午夜 | 尤物在线视频 | 欧美一级在线观看 | 精品久久久久久亚洲精品 | 黄色在线免费网站 | 女人精96xxx免费网站p | 精品欧美乱码久久久久久1区2区 | 亚欧精品一区 | 日韩中文久久 | 欧美日韩在线免费观看 | 久久久无码精品亚洲日韩按摩 | 亚洲一区中文字幕 | 午夜免费福利电影 |