Android-Support-Preference-V7-Fix
Android-Support-Preference-V7-Fix copied to clipboard
how to get items from custom view
I have a custom preference layout because I needed a progress dialog in one of my preferences, so I used a custom widget layout and just created a simple ConstraintLayout with a ProgressBar in it. The problem I am having is, I can't get a hold of that ProgressBar from my PreferenceFragment to update the progress based on the action that is happening. Essentially I am allowing a user to reset their app, it deletes all the SharedPreferences, then exits the app and restarts it. I am using commit() not apply() for the SharedPreferences because using apply() then calling exit() and loading the app back up, the SharedPreferences don't actually get wiped. The app loads with the old preferences still in tact. All that aside, I need to know how to get a hold of the ProgressBar that is inside a custom widget layout from the PreferenceFragment. I can provide code samples if needed, it is pretty simple so I wasn't sure if it was needed. Thank you.
Some code would be helpful. It basically depends on what techniques you use now.