問題描述
我正在開發一個應用程序,該應用程序從 Web 服務獲取一些數據并顯示在列表視圖中.我已經實現了一個由 BaseAdapter 擴展的自定義適配器.在 getView()
方法中,我也對原始數據進行了充氣.這些都工作得很好.
I am developing a application which fetches some data from a web service and displays in a list view. I have implemented a custom adapter which is extended by BaseAdapter. In the getView()
method I inflate the raw also.. Those are working perfectly.
我的問題是我已經實現了代碼以在用戶單擊列表項時顯示一個對話框,但現在我想顯示另一個對話框,其中包含一個自定義列表(單擊是"按鈕時).我還想在該列表視圖中顯示一些數據.[我有一個 ArrayList 填充了我想要的數據].我正在我的適配器類中編寫代碼.誰能給我一些想法怎么做?
My problem is I have implemented code to show a dialog box when user click on an list item, but now I want to show another dialog box which has a custom list inside it (when Yes button clicked). I also want to show some data in that listview. [I have a ArrayList filled with the data that I wanted] . I'm writing the code inside my adapter class. Can anyone give me some idea how to do it ?
這是我的代碼:
推薦答案
你在正確的軌道上,這是我用來動態顯示一個包含項目列表的對話框.
You are on the right track, Here is what i used to dynamically display a Dialog with a list of items in it.
這里提出了一個類似的問題作為參考:Android 自定義列表對話框
For reference a similar Question was asked here : Android custom list dialog
希望這能解決您的問題.
Hope this sorts out your problem.
這篇關于如何將自定義列表視圖設置為對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!