久久久久久久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 自定義列表對話框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述


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

                  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.

                  推薦答案

                  您收到的項目整數(shù)是包含您的操作的字符序列數(shù)組的索引,因此要獲取選擇的操作,您可以這樣做(在您的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
                  }
                  

                  但首選第一種方法

                  這篇關(guān)于Android 自定義列表對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  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 或網(wǎng)絡提供商)
                  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'>

                            主站蜘蛛池模板: 亚洲精品国产第一综合99久久 | 天天久久 | 天天操一操| 亚洲免费视频一区 | 久久九九网站 | 一本大道久久a久久精二百 欧洲一区二区三区 | 国产一区二区麻豆 | 九九亚洲 | 久久免费视频在线 | 成人国产精品免费观看视频 | 成人精品在线视频 | 亚洲午夜电影 | 成人在线一区二区 | 免费人成在线观看网站 | 超碰成人免费 | 91视视频在线观看入口直接观看 | 夜夜爽99久久国产综合精品女不卡 | 久久精品国产一区老色匹 | 久久久久久电影 | www.狠狠干 | 羞羞的视频在线 | 中文字幕第一页在线 | 亚洲高清在线免费观看 | 91精品国产高清一区二区三区 | 午夜看片网站 | av电影一区 | 亚洲精品久久久一区二区三区 | 综合激情av | 国产精品一区三区 | 在线只有精品 | 国产亚洲精品久久久优势 | 亚洲最大av | 亚洲视频一区在线观看 | 精品久久久久久久人人人人传媒 | 神马久久久久久久久久 | 欧洲一区二区在线 | 犬夜叉在线观看 | 欧美久久一区 | a久久| 久草www | 中文字幕乱码一区二区三区 |