-2

I am working with fragments. I am using two fragments and its working fine in some cases. After rotation of the device overlapping of fragments data take place in some cases.

However I have tried to save the state of fragments and all. But its not working.

j0k
  • 22,600
  • 28
  • 79
  • 90
Absar Alam
  • 102
  • 2
  • 9

1 Answers1

2

use .replace() on your fragment transaction. It usually solves 90% of overlapping fragments.

Budius
  • 39,391
  • 16
  • 102
  • 144
  • not at all, it makes things more complicated because replace() methode donot remove replaced(old one) fragment from container – Arvis Jan 11 '13 at 16:53
  • yes it does. That's why it is called 'replace' and that's why the person marked my answer as correct. – Budius Jan 11 '13 at 16:55
  • :) ok, maybe you have advise to my problem too http://stackoverflow.com/questions/14269350/how-to-keep-only-first-initial-fragment-in-back-stack-fragment-overlapping ? – Arvis Jan 11 '13 at 16:57
  • I mean, Old fragment View is Destroyed but not Detached on replace() callback. – Arvis Jan 11 '13 at 17:00
  • I've just answered your question, I'm sure it's the right answer. Check it out. – Budius Jan 11 '13 at 17:12