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

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

        <tfoot id='Xyxvp'></tfoot>

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

        <legend id='Xyxvp'><style id='Xyxvp'><dir id='Xyxvp'><q id='Xyxvp'></q></dir></style></legend>
        • <bdo id='Xyxvp'></bdo><ul id='Xyxvp'></ul>
      2. Android 自定義列表對話框

        Android custom list dialog(Android 自定義列表對話框)

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

            • <bdo id='riZf3'></bdo><ul id='riZf3'></ul>
                <tbody id='riZf3'></tbody>

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

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

                  本文介紹了Android 自定義列表對話框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述


                  我正在開發一個簡單的文件瀏覽器應用程序.我有大部分設置(它在不同的目錄中列出了一切,而且沒有),但我現在被困在一起(在幾個小時內工作了幾個小時)是選擇列表項目時,我想要出現一個自定義列表對話框.我在android開發頁面上找到了這段代碼并稍微修改了一下.目前它只是對所選內容進行了祝酒,但我需要將這三個項目分開.也就是說,我想做的不僅僅是祝酒,讓每個選擇運行不同的命令.這是我當前的代碼

                  Hi,
                  I'm working on a simple file browser app. I have most of it set up (where it lists everything out in the different directories and what not) but what I'm stuck on right now (worked on it for a few hours) is when a list item is selected, I want to have a custom list dialog appear. I found this code on the android development page and modded it slightly. Currently it just gives a toast of what was selected but I need the three items to be separate. That is, I'd like to do more than a toast and have each selection run different commands. Here is my current code

                      final CharSequence[] items = {"Info", "Rename", "Delete"};
                  
                      AlertDialog.Builder builder = new AlertDialog.Builder(this);
                      builder.setTitle("Options for " + file.getName());
                      builder.setItems(items, new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int item) {
                              Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
                          }
                      }).show();
                  

                  感謝任何可以幫助我將其分開的人.我嘗試了幾種不同的 if 語句變體,但我嘗試過的一切都失敗了.

                  Thanks to anyone who can help me just separate it. I've tried a few different variations of if statements and what not but everything I've tried has failed.

                  推薦答案

                  您收到的項目整數是包含您的操作的字符序列數組的索引,因此要獲取選擇的操作,您可以這樣做(在您的onClick 方法):

                  The item integer you receive is the index of the charsequence array that contains your actions, so to get the action that was selected you could do like this (inside your onClick method):

                  if (item == 0)
                  {
                       // Info item
                  }
                  else if (item == 1)
                  {
                       // Rename, and so one
                  

                  或者你可以這樣做:

                  if (items[item].equals("Info"))
                  {
                       // Info item
                  }
                  else if (items[item].equals("Rename")
                  {
                       // Rename, and so one
                  }
                  

                  但首選第一種方法

                  這篇關于Android 自定義列表對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='IV2Nv'></bdo><ul id='IV2Nv'></ul>

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

                          <tbody id='IV2Nv'></tbody>
                        • <tfoot id='IV2Nv'></tfoot>

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

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

                            主站蜘蛛池模板: 中文字幕一区二区三区四区五区 | 欧美日韩网站 | 午夜影院视频 | 在线观看av免费 | 久久成人18免费网站 | 亚洲精精品 | 3级毛片 | 国产精品久久久久久久久久免费看 | 亚洲成人av在线播放 | 久草在线在线精品观看 | 天堂视频一区 | 亚洲精品亚洲人成人网 | 一级欧美一级日韩片 | 日一区二区三区 | 久久国产精品网站 | 一区在线播放 | 国产亚洲成av人片在线观看桃 | 日韩欧美精品 | 免费一级毛片 | 亚洲福利精品 | 男女羞羞视频在线免费观看 | 国产福利在线播放麻豆 | 男人天堂999 | 日日夜夜91 | 色桃网 | 91视视频在线观看入口直接观看 | 亚洲国产欧美91 | 亚洲精品自在在线观看 | 久久精品免费 | 91看片| 精品一区二区三区在线播放 | 久久久久国产视频 | 亚洲区一区二 | 一级毛片在线播放 | 日韩成人影院 | 亚州激情| 久久成人18免费网站 | 男女羞羞视频在线看 | 日韩中文一区 | 视频在线亚洲 | 国际精品鲁一鲁一区二区小说 |