diff --git a/astrid/src/com/todoroo/astrid/activity/AstridWrapperActivity.java b/astrid/src/com/todoroo/astrid/activity/AstridWrapperActivity.java index 9cc79f48e..a88759583 100644 --- a/astrid/src/com/todoroo/astrid/activity/AstridWrapperActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/AstridWrapperActivity.java @@ -6,7 +6,6 @@ import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; -import android.view.ViewGroup; import com.timsu.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; @@ -169,20 +168,13 @@ public class AstridWrapperActivity extends FragmentActivity protected void setupFilterlistFragment() { FragmentManager manager = getSupportFragmentManager(); FragmentTransaction transaction = manager.beginTransaction(); - FilterListActivity frag = getFilterListFragment(); - if (frag == null) - frag = new FilterListActivity(); - - ViewGroup container = (ViewGroup) findViewById(R.id.filterlist_fragment_container); - if (container != null) { - if (container.getChildCount() > 0) - transaction.replace(R.id.filterlist_fragment_container, frag, FilterListActivity.TAG_FILTERLIST_FRAGMENT); - else - transaction.add(R.id.filterlist_fragment_container, frag, FilterListActivity.TAG_FILTERLIST_FRAGMENT); + FilterListActivity newFragment = new FilterListActivity(); + if (findViewById(R.id.filterlist_fragment_container) != null) { + transaction.replace(R.id.filterlist_fragment_container, newFragment, FilterListActivity.TAG_FILTERLIST_FRAGMENT); } else { if (getFilterListFragment() != null) return; - transaction.add(frag, FilterListActivity.TAG_FILTERLIST_FRAGMENT); + transaction.add(newFragment, FilterListActivity.TAG_FILTERLIST_FRAGMENT); } transaction.commit(); }