[Bug]: Set due date setting is cannot be searched
Purpose / Description
Set due date setting is cannot be searched
Fixes
- Fixes #16603
How Has This Been Tested?
physical device SDK 34
Screenshot
Checklist
Please, go through these checks before submitting the PR.
- [x] You have a descriptive commit message with a short title (first line, max 50 chars).
- [x] You have commented your code, particularly in hard-to-understand areas
- [x] You have performed a self-review of your own code
- [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [x] UI Changes: You have tested your change using the Google Accessibility Scanner
[!IMPORTANT] Maintainers: This PR contains https://github.com/ankidroid/Anki-Android/labels/Strings changes
- Sync Translations before merging this PR and wait for the action to complete
- Review and merge the auto-generated PR in order to sync all user-submitted translations
- Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review
Hi @david-allison ,when trying to set the title of the "Set Due Date" ListPreference dynamically from the HeaderFragment. The problem occurs because you're trying to access the ListPreference('Set due date'), which is defined in preferences_controls.xml, while the HeaderFragment is loading its preferences from R.xml.preference_headers. Since the ListPreference isn't part of the current preference screen loaded by the HeaderFragment, it results in a null reference when you try to access it.
In other words, the fragment is only aware of the preferences defined in preference_headers.xml and doesn't have access to the preferences from preferences_controls.xml. That's why you're unable to dynamically set the title of the ListPreference("Set due date")