From 5e99572c78c2384deaee8c4c0d9696a411a5b73a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 22 Oct 2013 18:34:21 +0400 Subject: [PATCH] attempt to fix sporadic unmarshalling problems by setting bundle classloader on saveinstancestate --- src/org/fox/ttrss/ArticleFragment.java | 1 + src/org/fox/ttrss/ArticlePager.java | 1 + src/org/fox/ttrss/FeedCategoriesFragment.java | 1 + src/org/fox/ttrss/FeedsFragment.java | 1 + src/org/fox/ttrss/GlobalState.java | 2 ++ src/org/fox/ttrss/HeadlinesFragment.java | 1 + 6 files changed, 7 insertions(+) diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index a26e7367..e7e249a5 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -369,6 +369,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl public void onSaveInstanceState (Bundle out) { super.onSaveInstanceState(out); + out.setClassLoader(getClass().getClassLoader()); out.putParcelable("article", m_article); } diff --git a/src/org/fox/ttrss/ArticlePager.java b/src/org/fox/ttrss/ArticlePager.java index ec42e57d..fed7f01e 100644 --- a/src/org/fox/ttrss/ArticlePager.java +++ b/src/org/fox/ttrss/ArticlePager.java @@ -261,6 +261,7 @@ public class ArticlePager extends Fragment { public void onSaveInstanceState(Bundle out) { super.onSaveInstanceState(out); + out.setClassLoader(getClass().getClassLoader()); out.putParcelable("article", m_article); out.putParcelable("feed", m_feed); } diff --git a/src/org/fox/ttrss/FeedCategoriesFragment.java b/src/org/fox/ttrss/FeedCategoriesFragment.java index df4e6dff..8a71c318 100644 --- a/src/org/fox/ttrss/FeedCategoriesFragment.java +++ b/src/org/fox/ttrss/FeedCategoriesFragment.java @@ -247,6 +247,7 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe public void onSaveInstanceState (Bundle out) { super.onSaveInstanceState(out); + out.setClassLoader(getClass().getClassLoader()); out.putParcelable("selectedCat", m_selectedCat); out.putParcelable("cats", m_cats); } diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index fe6ba048..8b4dd05b 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -290,6 +290,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh public void onSaveInstanceState (Bundle out) { super.onSaveInstanceState(out); + out.setClassLoader(getClass().getClassLoader()); out.putParcelable("selectedFeed", m_selectedFeed); out.putParcelable("feeds", m_feeds); out.putBoolean("feedIconsChecked", m_feedIconsChecked); diff --git a/src/org/fox/ttrss/GlobalState.java b/src/org/fox/ttrss/GlobalState.java index 830ed6b7..6f81fc5d 100644 --- a/src/org/fox/ttrss/GlobalState.java +++ b/src/org/fox/ttrss/GlobalState.java @@ -32,6 +32,8 @@ public class GlobalState extends Application { } public void save(Bundle out) { + + out.setClassLoader(getClass().getClassLoader()); out.putParcelableArrayList("gs:loadedArticles", m_loadedArticles); out.putParcelable("gs:activeFeed", m_activeFeed); out.putParcelable("gs:activeArticle", m_activeArticle); diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index c23889aa..a8baa915 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -499,6 +499,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, public void onSaveInstanceState (Bundle out) { super.onSaveInstanceState(out); + out.setClassLoader(getClass().getClassLoader()); out.putParcelable("feed", m_feed); //out.putParcelable("articles", m_articles); out.putParcelable("activeArticle", m_activeArticle);