У меня есть панель действий с 3 вкладками, каждая вкладка открывает фрагмент. На третьей вкладке "Каталог" есть список:
Когда я нажимаю на элемент, он открывает другой фрагмент, который не является частью панели действий:
public void onClick(View v) {
switch (v.getId())
{
case R.id.category1:
Fragment cosmeticsFragment = new ActivityCosmetics();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(android.R.id.content, cosmeticsFragment);
transaction.addToBackStack(null);
transaction.setTransition(1);
transaction.commit();
break;
...
Вот как это выглядит после этого:
С этого момента, если я перейду на другую вкладку и вернусь на вкладку "Каталог", я вижу, что два предыдущих фрагмента перекрывают друг друга:
Как я могу предотвратить это?