pass article to detailactivity via application to prevent transaction_too_large

This commit is contained in:
Andrew Dolgov 2015-07-17 10:31:41 +03:00
parent a0ba123b43
commit 1264f3043c
3 changed files with 7 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import android.os.Bundle;
import org.acra.ACRA; import org.acra.ACRA;
import org.acra.ReportingInteractionMode; import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes; import org.acra.annotation.ReportsCrashes;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.ArticleList; import org.fox.ttrss.types.ArticleList;
@ReportsCrashes(formKey = "", mode = ReportingInteractionMode.DIALOG, @ReportsCrashes(formKey = "", mode = ReportingInteractionMode.DIALOG,
@ -15,13 +16,14 @@ public class Application extends android.app.Application {
private static Application m_singleton; private static Application m_singleton;
public ArticleList tmpArticleList; public ArticleList tmpArticleList;
public Article tmpArticle;
//public Feed m_activeFeed; //public Feed m_activeFeed;
//public Article m_activeArticle; //public Article m_activeArticle;
public int m_selectedArticleId; public int m_selectedArticleId;
public String m_sessionId; public String m_sessionId;
public int m_apiLevel; public int m_apiLevel;
public boolean m_canUseProgress; public boolean m_canUseProgress;
public static Application getInstance(){ public static Application getInstance(){
return m_singleton; return m_singleton;
} }

View File

@ -79,7 +79,8 @@ public class DetailActivity extends OnlineActivity implements HeadlinesEventList
final Feed feed = tmpFeed; final Feed feed = tmpFeed;
final Article article = i.getParcelableExtra("article"); //final Article article = i.getParcelableExtra("article");
final Article article = Application.getInstance().tmpArticle;
final String searchQuery = i.getStringExtra("searchQuery"); final String searchQuery = i.getStringExtra("searchQuery");
ArticleList tmp = Application.getInstance().tmpArticleList; ArticleList tmp = Application.getInstance().tmpArticleList;

View File

@ -438,10 +438,11 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList
Intent intent = new Intent(MasterActivity.this, DetailActivity.class); Intent intent = new Intent(MasterActivity.this, DetailActivity.class);
intent.putExtra("feed", hf.getFeed()); intent.putExtra("feed", hf.getFeed());
intent.putExtra("article", article); //intent.putExtra("article", article);
intent.putExtra("searchQuery", hf.getSearchQuery()); intent.putExtra("searchQuery", hf.getSearchQuery());
//intent.putExtra("articles", (Parcelable)hf.getAllArticles()); //intent.putExtra("articles", (Parcelable)hf.getAllArticles());
Application.getInstance().tmpArticleList = hf.getAllArticles(); Application.getInstance().tmpArticleList = hf.getAllArticles();
Application.getInstance().tmpArticle = article;
/* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
startActivityForResult(intent, HEADLINES_REQUEST, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); startActivityForResult(intent, HEADLINES_REQUEST, ActivityOptions.makeSceneTransitionAnimation(this).toBundle());