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 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]);