0

Sorry for my poor English.. but i have two problems and i cant go on.

I have a app (Android) and i'm working with Fragments.

Problem: * I have the main activity and 3 fragments (to show other information's)

In the main activity i call the fragment and i put him in backstack. addToBackStack(null) and i not add a fragment..the code is "replace". always when i call a fragment i add in backstack. And when i click in menu to show the fragment, show normally without problems.

BUT When i press the "Android Home Button" to show the "Android home screen" and i click again in my app THE LAST fragment disappear.

When i click to show the recent applications in android and back to app, same thing... the last fragment disappear...

I read something to manage onResume, but i'm blocked on this.

PS: Always when i press HomeButton or Recent Applications, i see on debug the fragment call "onDestroy" and the getBackStackEntryCount() is 0.

Sorry i don't have code in this PC..but if someone help me with this..i will be very happy!.. after i will put the code here!

HomeButton

RecentApplication

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • Could you please update your question with the relevant code? – RamithDR Aug 30 '16 at 14:55
  • I dont have the code in this moment..just when i came from the work. but i will write something and post it now – Lucas Bergamo Aug 30 '16 at 15:08
  • Sorry i cant put correctly the code.. but thinking in the problem... i cant see the last fragment when i click in device homebutton ou recent application list.. i put two images in the first post. – Lucas Bergamo Aug 30 '16 at 15:30

1 Answers1

0
android:noHistory="true"  

I think the problem is this..