TUM-Dev / Campus-Android

Development of the TUM Campus App for Android devices - for and from students at Technical University of Munich.
https://app.tum.de
GNU General Public License v3.0
208 stars 86 forks source link

App crash navigation drawer fix #1594

Closed kunzef closed 1 year ago

kunzef commented 1 year ago

Issue

This fixes the following issue(s):

Description of the fix

The error source of #1589 is the difference between the System locale and the Application locale. Somehow the Campus-App fails to correctly set its own Application locale. This leads to the crash as the NavigatioDrawer causing it, tries to find the clicked NavItem with a localized String resource. For example see this part of code from the NavigationDrawer menuItem.title == activity.getString(HOME.titleRes) here menuItem.title is based in the Application locale where under certain cirqumstances activity.getString() uses the System locale. It uses the System locale after any of the NavItem.ActivityDestination has been opened.

Why this is useful for all students

While it does not solve the underlying problem it still prevents the App from crashing and thus is at least a bit.

Further todos

The main problem causing this other problems and #1585 as well as maybe others is not solved with this. In regards to this I have openend the issue #1593 See there for further details.