Fix a issue on Android 5.0

This commit is contained in:
Pierre 2018-04-12 15:35:51 +02:00
parent fb113c0506
commit 104ddfb8cb
2 changed files with 10 additions and 15 deletions

View File

@ -85,14 +85,14 @@ public class NotificationsFragment extends Fragment implements View.OnCreateCont
private onPostOpenListener mOpenPostListener; private onPostOpenListener mOpenPostListener;
@Override @Override
public void onAttach(Context context) { public void onCreate(@Nullable Bundle savedInstanceState) {
super.onAttach(context); super.onCreate(savedInstanceState);
//Create notifications helper //Create notifications helper
mNotificationsHelper = new NotificationsHelper(context); mNotificationsHelper = new NotificationsHelper(getActivity());
//Create get users helper //Create get users helper
mUsersInfoHelper = new GetUsersHelper(context); mUsersInfoHelper = new GetUsersHelper(getActivity());
} }
@Nullable @Nullable

View File

@ -65,23 +65,18 @@ public class SinglePostFragment extends Fragment {
*/ */
private GetUsersHelper mGetUserHelper; private GetUsersHelper mGetUserHelper;
@Override
public void onAttach(Context context) {
super.onAttach(context);
//Create post helper
mPostsHelper = new PostsHelper(context);
//Create get user helper
mGetUserHelper = new GetUsersHelper(context);
}
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
//Get post ID //Get post ID
mPostID = getArguments().getInt(ARGUMENT_POST_ID); mPostID = getArguments().getInt(ARGUMENT_POST_ID);
//Create post helper
mPostsHelper = new PostsHelper(getActivity());
//Create get user helper
mGetUserHelper = new GetUsersHelper(getActivity());
} }
@Nullable @Nullable