From 27f129ad4c9ded0b186d944290a47abb886b5363 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 27 Jan 2012 13:07:47 +0300 Subject: [PATCH] dump active headlines fragment when closing feed --- src/org/fox/ttrss/MainActivity.java | 12 ++++++++++++ src/org/fox/ttrss/OfflineActivity.java | 12 ++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 54660382..5bf066b0 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -781,6 +781,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices { View.GONE); findViewById(R.id.cats_fragment) .setVisibility(View.VISIBLE); + + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + ft.replace(R.id.headlines_fragment, new HeadlinesFragment()); + ft.commit(); FeedCategoriesFragment cf = (FeedCategoriesFragment) getSupportFragmentManager() .findFragmentById(R.id.cats_fragment); @@ -796,6 +800,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices { findViewById(R.id.feeds_fragment).setVisibility( View.VISIBLE); + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + ft.replace(R.id.headlines_fragment, new HeadlinesFragment()); + ft.commit(); + refreshFeeds(); } @@ -840,6 +848,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices { m_activeFeed = null; + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + ft.replace(R.id.headlines_fragment, new HeadlinesFragment()); + ft.commit(); + refreshFeeds(); initMainMenu(); diff --git a/src/org/fox/ttrss/OfflineActivity.java b/src/org/fox/ttrss/OfflineActivity.java index ec53a80a..ff157ab8 100644 --- a/src/org/fox/ttrss/OfflineActivity.java +++ b/src/org/fox/ttrss/OfflineActivity.java @@ -7,9 +7,9 @@ import android.app.Dialog; import android.app.NotificationManager; import android.content.Context; import android.content.DialogInterface; +import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.SharedPreferences; -import android.content.DialogInterface.OnClickListener; import android.content.res.Configuration; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -339,6 +339,10 @@ public class OfflineActivity extends FragmentActivity implements ff.setSelectedFeedId(0); } + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + ft.replace(R.id.headlines_fragment, new OfflineHeadlinesFragment()); + ft.commit(); + refreshViews(); initMainMenu(); @@ -358,7 +362,11 @@ public class OfflineActivity extends FragmentActivity implements if (ff != null) { ff.setSelectedFeedId(0); } - + + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + ft.replace(R.id.headlines_fragment, new OfflineHeadlinesFragment()); + ft.commit(); + refreshViews(); initMainMenu();