Fragments icon indicating copy to clipboard operation
Fragments copied to clipboard

Improve the call of MainActivity setViewPager

Open MaherSoua opened this issue 7 years ago • 1 comments

https://github.com/mitchtabian/Fragments/blob/4b0a74809f986563b694eb8ca89a595d1edb984e/Fragements/app/src/main/java/tabian/com/fragements/Fragment1.java#L49 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; }

MaherSoua avatar Oct 19 '17 23:10 MaherSoua

Do whatever works for you.

mitchtabian avatar Oct 19 '17 23:10 mitchtabian