Open parjanyaacoder opened 4 years ago
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.70. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
I need help in resolving this issue.
I went through it. You need to implement two-way callback for setting the visibility of menu item. The issue here is that when the screen is rotated, the activity restarts as part of normal lifecycle. But since no parameters are changed on this restart, so the API request is resent and response is received in an instant (probably from a cached version of the API response). But the UI elements are not initialized so fast, so a NPE is observed. To fix this, you can maintain a flag which checks whether the visibility related task has been completed or not. You have to set this flag true only when the task is complete. Now, you need to check for null in the onLoadFinished callback, and if null is not found, set the visibility as needed and set flag to true. If a null is found, set flag to false. Now you need to implement the same code related to the visibility check in onCreate, which should run only if the flag was false. This way I think this issue will be resolved.
The bug is that the app does not support Landscape mode. The app only supports Portrait Mode.On Switching from portrait to landscape mode or vice versa the app crashes.
To Reproduce Steps to reproduce the behavior:
Expected behavior As Expected the app should have supported the Layout Orientation of the phone as well.
Screenshots
Would you like to work on the issue? Yes