From 48f680ba96037ba163001bb817c747d34000c02d Mon Sep 17 00:00:00 2001 From: Ivan Kupalov Date: Mon, 2 Jul 2018 22:12:27 +0200 Subject: [PATCH] Fix crash on receiving event in timeline (#704) --- .../tusky/fragment/TimelineFragment.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index e5c7a71a..7b26d393 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -196,14 +196,21 @@ public class TimelineFragment extends SFragment implements } @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); Bundle arguments = Objects.requireNonNull(getArguments()); kind = Kind.valueOf(arguments.getString(KIND_ARG)); - if (kind == Kind.TAG || kind == Kind.USER || kind == Kind.USER_WITH_REPLIES|| kind == Kind.LIST) { + if (kind == Kind.TAG + || kind == Kind.USER + || kind == Kind.USER_WITH_REPLIES + || kind == Kind.LIST) { hashtagOrId = arguments.getString(HASHTAG_OR_ID_ARG); } + } + @Override + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.fragment_timeline, container, false); recyclerView = rootView.findViewById(R.id.recycler_view);