Skip to content

Conversation

@albendz
Copy link
Contributor

@albendz albendz commented Jul 29, 2019

Description (required)

Fixes #3032 Dialog Not Showing UP

What changes did you make and why?

Tests performed (required)

Tested Debug on Pixel XL with API level 26.

  1. On a screen with a dialog
  2. Suspend
  3. Resume

Verified: no exception and no duplicated dialogs

No UI changes.

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@ilgazer
Copy link
Contributor

ilgazer commented Jul 30, 2019

On a screen with a dialog
Suspend
Resume

I cannot duplicate the original bug in Genymotion API 23. Do you consistently get double dialogs when you follow these steps?

@albendz
Copy link
Contributor Author

albendz commented Aug 2, 2019

I messed that one up - you will not get double dialogs, that was part of a debug change I made. You will see the exception though.

To elaborate on this: if you found the parent view and detached the custom view, you would be able to successfully create a second dialog but it would duplicate the first and you'd end up with two. Thus, a successful fix results in no exception and no duplicate dialogs.

@neslihanturan
Copy link
Collaborator

Hi @albendz , I approved this by reading the code but can you provide me the test scenario so that I can test it too?

@albendz
Copy link
Contributor Author

albendz commented Nov 6, 2019

I'm having trouble building latest from master (some gradle build failure on debug resources) so I'm not able to retry the steps but from what I remember:

  1. Disable location
  2. Open the app to see the location permissions dialog
  3. Suspend the app
  4. Resume

You will see in logs an error about a dialog parent. The dialog is actually being created again with the same inner content view, which is where this error is happening. The original dialog isn't being dismissed, it's the new one that doesn't actually get created.

@albendz
Copy link
Contributor Author

albendz commented Nov 8, 2019

Confirmed that is the repo. You will get this error in the logs:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

Copy link
Collaborator

@neslihanturan neslihanturan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified, this works for me. Thanks a lot @albendz , and sorry for latency.

@neslihanturan neslihanturan merged commit 0c98f59 into commons-app:master Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialog not showing up.

3 participants