Merge pull request #2688 from yunikkk/crashfix

[android] Crashfixes.
This commit is contained in:
Alexander Marchuk 2016-04-01 16:41:17 +03:00
commit 72763af6c5
2 changed files with 3 additions and 2 deletions

View file

@ -189,7 +189,8 @@ public class DownloaderFragment extends BaseMwmRecyclerFragment
public void onDestroy()
{
super.onDestroy();
getRecyclerView().removeOnScrollListener(mScrollListener);
if (getRecyclerView() != null)
getRecyclerView().removeOnScrollListener(mScrollListener);
}
@Override

View file

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