Hm poradziłem sobie z tym poprzez ustawienie gridView na invisible po zmianie fragmentu. Niestety lepszego sposobu nie znalazłem, jak ktoś ma inny niech poda 🙂
A fragmenty dodaje tak:
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
FragmentManager fm = getFragmentManager();
final FragmentTransaction fragmentTransaction = fm.beginTransaction();
switch (pos) {
case 0:
fr = new SteeringNormalFragment();
fragmentTransaction.replace(R.id.fragment_place, fr);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
gridview.setVisibility(View.INVISIBLE);
break;
case 1:
fr = new SteeringSensorFragment();
fragmentTransaction.replace(R.id.fragment_place, fr);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
gridview.setVisibility(View.INVISIBLE);
break;
case 2:
fr = new SteeringSwipeFragment();
fragmentTransaction.replace(R.id.fragment_place, fr);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
gridview.setVisibility(View.INVISIBLE);
break;
case 3:
fr = new SteeringVoiceFragment();
fragmentTransaction.replace(R.id.fragment_place, fr);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
gridview.setVisibility(View.INVISIBLE);
break;
default:
break;
}
}