-1

I created a custom dialog box android activity in a separate class.
The dialog box has a button which adds an item to listview whenever it is clicked.
The list view is declared in the base activity.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • You have to store that value locally and then use it in that activity to set list. – R.R.M Dec 01 '17 at 10:47
  • Your question is badly formatted. Could you provide us with your existing code? – dniHze Dec 01 '17 at 10:50
  • provide more information please! Which listview adapter are you using? how does the dialog add the item? how is the listview being decalred? – Yamen Nassif Dec 01 '17 at 10:54

1 Answers1

0

I suggest you use a combination of DialogFragment and Callback for this issue.

Implement like this answer in this, and make some adjustments. in your button onClick(), call YourInterface.method().

This will trigger the method you override on your BaseActivity, which you do add a item into your ListView.

Sơn Phạm
  • 129
  • 1
  • 5