diff options
-rw-r--r-- | src/org/fox/ttrss/widget/WidgetUpdateService.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/org/fox/ttrss/widget/WidgetUpdateService.java b/src/org/fox/ttrss/widget/WidgetUpdateService.java index 3886339c..5d07970a 100644 --- a/src/org/fox/ttrss/widget/WidgetUpdateService.java +++ b/src/org/fox/ttrss/widget/WidgetUpdateService.java @@ -78,18 +78,22 @@ public class WidgetUpdateService extends Service { @Override
protected void onPostExecute(JsonElement result) {
if (result != null) {
- JsonObject content = result.getAsJsonObject();
-
- if (content != null) {
- int unread = content.get("unread").getAsInt();
-
- view.setViewVisibility(R.id.progress, View.GONE);
- view.setTextViewText(R.id.counter, String.valueOf(unread));
- manager.updateAppWidget(thisWidget, view);
-
- return;
- }
- }
+ try {
+ JsonObject content = result.getAsJsonObject();
+
+ if (content != null) {
+ int unread = content.get("unread").getAsInt();
+
+ view.setViewVisibility(R.id.progress, View.GONE);
+ view.setTextViewText(R.id.counter, String.valueOf(unread));
+ manager.updateAppWidget(thisWidget, view);
+
+ return;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
view.setViewVisibility(R.id.progress, View.GONE);
view.setTextViewText(R.id.counter, "?");
|