I'm building an app with Android Studio.
I have an Actvity with some fragments. These fragments extends a BaseFragment Class In one of this Fragment I have a ListView with custon Adapter. I have implements a ClickListener of this ListView like this:
lvMyResults = view.findViewById(R.id.lvMyResults);
lvMyResults.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Food foodItem = (Food) parent.getAdapter().getItem(position);
addFoodToMeal(foodItem);
}
});
The method addFoodToMeal, show at the user an Alert Dialog. Now I want to refresh the list view after then the user close this AlertDialog.
Can I intercept the close of Dialog from onItemClickListener?