сделать элементы списка невидимыми в диалоге оповещений - PullRequest
2 голосов
/ 24 февраля 2012

Я создал диалоговое окно предупреждения, используя следующий код, и вставил в него элементы списка

теперь я хочу сделать этот элемент невидимым или удалить из диалога, это способ сделать это

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>

1 Ответ

0 голосов
/ 24 февраля 2012

используйте это: title.setVisibility (View.GONE);

...