2
我使用下面的代碼創建一個警告對話框,並插入裏面在警告對話框
現在我想使這個項目不可見或刪除對話框內的列表項無形使列表項,是一個辦法做到它
AlertDialog.Builder builder = new AlertDialog.Builder(this);
LayoutInflater factory = LayoutInflater.from(this);
final View directionEntryView = factory.inflate(R.layout.contact_dialog, null);
title.setText(contactStore.getContactName());
builder.setTitle(contactStore.getContactName());
/** Once I fill the item list , i want to make it invisible **/
builder.setItems(R.array.select_dialog_items, null);
項目列表如下
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="select_dialog_items" >
<item>Command one</item>
<item>Command two</item>
<item>Command three</item>
<item>Command four</item>
</string-array>
</resources>
你想隱藏*一個*的項目? – dacwe 2012-02-24 14:35:25
不,整個列表,但我只能在數組中只放一個項目,所以最終它將隱藏整個列表我猜 – Hunt 2012-02-24 14:38:26