refreshing a dialoglist

3 views
Skip to first unread message

bernhard

unread,
Feb 20, 2012, 4:06:04 PM2/20/12
to Android Programming at USF
hi,

still struggling with the dialoglist :)
If I open the Dialog with

showDialog(dialogid)
.....

protected Dialog onCreateDialog(int dialogid) {
dbg("showing dialog");
itemsShown = addressinfo.toArray(new String[addressinfo.size()]);
return new AlertDialog.Builder(ListPickerCbRbActivity.this)
.setTitle("Please pick one:")
.setItems(itemsShown, ...
...

the Dialog will not refresh the data shown if it has changed.

Calling removeDialog(dialogid) before calling showDialog solves the
problem - but the preferred method would
be using onPrepareDialog. But in onPrepareDialog I don't manage call
setItems - anybody knows how?

protected void onPrepareDialog (int id, Dialog dialog){
//somehow call setitems here?

}

thx
Bernhard
Reply all
Reply to author
Forward
0 new messages