Added panoramio request-friendliness onCreateView.

master
Tomasz Półgrabia 2016-09-18 11:49:29 +02:00
parent fcf9f75aee
commit 085db85ce0
1 changed files with 10 additions and 8 deletions

View File

@ -116,14 +116,16 @@ public class HomeFragment extends Fragment {
initialized = true;
lg.trace("Saved instance state {}", savedInstanceState);
if (savedInstanceState == null) {
lg.trace("Saved instance state is null");
photos = new ArrayList<>();
}
else {
final Serializable serializable = savedInstanceState.getSerializable(PHOTO_LIST);
lg.trace("Photo list serializable {}", serializable);
photos = (ArrayList<PanoramioImageInfo>) serializable;
if (photos == null) {
if (savedInstanceState == null) {
lg.trace("Saved instance state is null");
photos = new ArrayList<>();
}
else {
final Serializable serializable = savedInstanceState.getSerializable(PHOTO_LIST);
lg.trace("Photo list serializable {}", serializable);
photos = (ArrayList<PanoramioImageInfo>) serializable;
}
}
locations.setAdapter(new PanoramioAdapter(getActivity(), R.layout.location_item, photos));