fix mystery crash on my phone

but not on emulator running same OS version (or close). And in spite of
an exception being thrown the work being done, hiding a preference,
still succeeds. Whatever.
This commit is contained in:
Eric House 2017-01-08 14:40:18 -08:00
parent fac8c2b943
commit 8c680b50f7

View file

@ -321,10 +321,16 @@ public class PrefsDelegate extends DelegateBase
private void hideOne( int prefID, int screenID )
{
Preference pref = m_activity.findPreference( getString( prefID ) );
String key = getString( screenID );
((PreferenceScreen)m_activity.findPreference( key ))
.removePreference( pref );
try {
Preference pref = m_activity.findPreference( getString( prefID ) );
String key = getString( screenID );
((PreferenceScreen)m_activity.findPreference( key ))
.removePreference( pref );
} catch ( NullPointerException ex ) {
// This is happening hiding key_enable_sms, but the hide still
// works!
// DbgUtils.logex( TAG, ex );
}
}
private void hideStuff()