久久久久久久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>
                            主站蜘蛛池模板: 成年精品 | 岛国在线免费观看 | 一区在线免费视频 | 福利视频一区 | 日本三级做a全过程在线观看 | 成人精品一区二区三区中文字幕 | 精品欧美 | 色婷婷久久久久swag精品 | 日韩中文字幕免费在线 | xxx.在线观看 | 亚洲精品日韩一区二区电影 | 亚洲一区网站 | 岛国av一区二区 | 欧美一区二区三区 | 久久久久久综合 | 精品国产第一区二区三区 | 欧美久久一级 | 日韩精品人成在线播放 | 日本久久精 | 91视频三区 | 国产午夜精品一区二区三区四区 | 国产一区久久精品 | 日韩欧美三区 | www.国产| 欧美激情精品久久久久久 | 不卡一区二区三区四区 | 狠狠爱一区二区三区 | 欧美精品一区二区三区在线播放 | 国内成人免费视频 | 99国产精品99久久久久久粉嫩 | 成人在线观看网址 | 国产精品一区二区久久 | 国产欧美精品一区二区三区 | 中文字幕一区在线 | 久久成人国产精品 | 精精国产视频 | 亚洲一区二区在线播放 | 国产高清精品一区二区三区 | 综合亚洲视频 | 国产精品a免费一区久久电影 | 欧美xxxx色视频在线观看免费 |