From 69d80a868a066a3250450a0d3ce441d9759e1e01 Mon Sep 17 00:00:00 2001 From: Andrew Jack Date: Tue, 27 Oct 2015 21:07:31 +0000 Subject: [PATCH] Fix "IllegalArgumentException: Span count should be at least 1. Provided 0" --- .../mainthread/apps/moment/ui/fragment/MomentsFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/technology/mainthread/apps/moment/ui/fragment/MomentsFragment.java b/mobile/src/main/java/technology/mainthread/apps/moment/ui/fragment/MomentsFragment.java index 71e6841..a934f0e 100644 --- a/mobile/src/main/java/technology/mainthread/apps/moment/ui/fragment/MomentsFragment.java +++ b/mobile/src/main/java/technology/mainthread/apps/moment/ui/fragment/MomentsFragment.java @@ -89,7 +89,8 @@ private int getSpanCount() { Display display = getActivity().getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); - return size.x / 600; + int i = size.x / 600; + return i > 0 ? i : 1; } @Override