Weird behaviour
Closed this issue · 1 comments
I think I am experiencing some weird behaviour when using this library. I have created a sample example with PageActivity and 2 pages namely LifeCycleTestPage & LifeCycleTestPageTwo (let's simplifie those names to be page A & page B) and overriden several methods to log.
In MainActivity's onCreate a call new A. In page B in onShown method after super.onShown call I make new pageB().show() call.
The problem is on the screen shot. Sometimes when I start my app fresh (starting from the logged line)
I get 2 calls from page B onShown() and onResume() methods.
http://i.imgur.com/k44kJNB.png
Any solution for this behaviour ? Also why is mContext in ViewWrapper calss deprecated ? Also I get some art GC debugg messages but I belive this might not be related.
From the screenshot I can see that LifeCycleTestPageTwo.onShown()
is called once, which is correct in your case. As for onResume()
, which is called for the page on top of the stack each time PageActivity.onResume()
is called, I also see that MainActivity.onPause()
is called followed by another onResume()
, did you turn off and on the screen or did anything that would cause Activity.onPause()
and Activity.onResume()
be called?
mContext
was deprecated because I wanted to make all the APIs more consistent, getContext()
can be used instead.