Skip to content

Odd code in CategoryImagesListFragment #3091

@ilgazer

Description

@ilgazer

In CategoryImagesListFragment, the code tries to cast the Context to 4 different activities and calls viewPagerNotifyDataSetChanged on each of them. This pattern is present in a few more classes. Does this have any advantages as opposed to implementing an interface?

        try {
            ((CategoryImagesActivity) getContext()).viewPagerNotifyDataSetChanged();
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            ((CategoryDetailsActivity) getContext()).viewPagerNotifyDataSetChanged();
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            ((ExploreActivity) getContext()).viewPagerNotifyDataSetChanged();
        }catch (Exception e){
            e.printStackTrace();
        }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions