From 952902b5f663641e75a8572befad87ef9454f571 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Fri, 1 Apr 2016 16:05:04 +0300 Subject: [PATCH 1/2] [android] Fixed possible crash. --- .../src/com/mapswithme/maps/downloader/DownloaderFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java b/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java index b8a7662b8c..61ca45607d 100644 --- a/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java +++ b/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java @@ -189,7 +189,8 @@ public class DownloaderFragment extends BaseMwmRecyclerFragment public void onDestroy() { super.onDestroy(); - getRecyclerView().removeOnScrollListener(mScrollListener); + if (getRecyclerView() != null) + getRecyclerView().removeOnScrollListener(mScrollListener); } @Override From 224f4f719432e5d0d79fc1bf900e172f292f1a46 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Fri, 1 Apr 2016 16:09:29 +0300 Subject: [PATCH 2/2] [android] Fixed possible crash on buggy samsungs. --- android/src/com/mapswithme/maps/news/BaseNewsFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/com/mapswithme/maps/news/BaseNewsFragment.java b/android/src/com/mapswithme/maps/news/BaseNewsFragment.java index ae6061b183..11515a438d 100644 --- a/android/src/com/mapswithme/maps/news/BaseNewsFragment.java +++ b/android/src/com/mapswithme/maps/news/BaseNewsFragment.java @@ -99,7 +99,7 @@ abstract class BaseNewsFragment extends BaseMwmDialogFragment @Override public Object instantiateItem(ViewGroup container, final int position) { - View res = LayoutInflater.from(getActivity()).inflate(R.layout.news_page, container, false); + View res = LayoutInflater.from(container.getContext()).inflate(R.layout.news_page, container, false); ((ImageView)res.findViewById(R.id.image)) .setImageResource(mImages[position]);