Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the call of MainActivity setViewPager #2

Open
MaherSoua opened this issue Oct 19, 2017 · 1 comment
Open

Improve the call of MainActivity setViewPager #2

MaherSoua opened this issue Oct 19, 2017 · 1 comment

Comments

@MaherSoua
Copy link

((MainActivity)getActivity()).setViewPager(1);

May be we can use onAttach(Context context) in Fragment classes, like that we can get the main activity and use its public method like that I mean:

MainActivity mMainActivity;
@OverRide
public void onAttach(Context context){
super.onAttach(context);
mMainActivity = (MainActivity) context;
}

@mitchtabian
Copy link
Owner

Do whatever works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants