bug fix: fragments are duplicated and overlaped#48
bug fix: fragments are duplicated and overlaped#48zdsfwy wants to merge 1 commit intoaporter:masterfrom zdsfwy:fix-overlaped-fragment
Conversation
|
Hi, Good Afternoon. I don't understanding your fix completely. If this was your solution I appreciate some lite explanation about it. ;) I think the Issue is about Fragment lifecycle. Thanks for your time, Joel Espinal (JoelEspinal) here a part snipped code: if(savedInstanceState != null) {
|
|
Hi, Joel. Thank you for reply. Sorry for leading to confusing. Let me explain When configuration(such as orientation) changes, android system would restart the app. Before restart, it would save certain information into Here is the link from google android site, where it uses exactly the same technique. |
Hi, professor.


In
FragmentProgrammaticLayout, the main Activity would add fragment wheneveronCreateis invoked. As a result, whenonCreateis invoked by configuration changing, duplicated fragments would be added and overlapped.Here are the screenshots.Before configuration change:
After configuration change(since new fragment is overlapped with old fragment, multiple items in the list appear to be selected):