I have ViewPager
of fragments and every fragment contains GridView
. The issue I am facing is ViewPager
calls getView
of GridView adapter many times. I want to change GridView
item views but multiple calls is creating issue in logic. Is there any way to block multiple calls or Is there any event that FragmentPagerAdapter
has created all fragments, then I send broadcast to all fragments to view changes?
UPDATE
if(AppPreferences.getString(AppPreferenceKeys.EDIT_INVOICE_NUMBER, "").length() > 0) {
int quantity = ((MainActivity) context).getQuantity(menu.getMenuCode() + "");
if (quantity > 0) {
holder.cv_menu.findViewById(R.id.rl_cv_menu).setBackgroundColor(context.getResources().getColor(R.color.accepted));
for (int i = 0; i < quantity; i++) {
// holder.cv_menu.performClick();
handleMenuItemClick(holder.cv_menu);
}
}
}