I have an application where I have contacts and groups. I can create them. But now I want to select contacts to add to a group. Is it possible to reuse the Listview (or adapter) from my original contacts_list to make a selection (like whatsapp)?
I have a HomeScreen with a tabbed interface with 2 layouts: fragment_contacts and fragment_groups. Fragment_contacts has a listview: contacts_list. There I have all information from the contacts (via an ContactsAdapter).
Now I have an activity: AddGroupActivity. That one is showing, where a group name can be entered. What is best practice to show a Listview below it with all contact to select from?
I don’t think copying everything is a good solution in this case, since it will only make it more difficult to change things later.
I tried passing the adapter from contacts_list to the activity in the OnCreate. But it gets called from the GroupFragment, where the ContactFragment does not exists and hence including the contact_list result in a null value, so passing the adapter as parameter does not work in this case.