milesmcc / LibreNews-Android

An Android client for the LibreNews server
GNU General Public License v3.0
35 stars 8 forks source link

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.View.getContext()' on a null object reference #23

Open tianxiaogu opened 7 years ago

tianxiaogu commented 7 years ago

Founded on Android Studio Emulator and can be reproduced on Nexus 5 (6.0.1)

Steps:

  1. Install v1.4 from FDroid
  2. Launch app.
  3. Enable Automatically refresh
  4. Click INFO
  5. Click GO TO LIBRENEWS
  6. Click BACK button
  7. Disable Automatically refresh
// CRASH: app.librenews.io.librenews (pid 3284) (elapsed nanos: 702931492114)
// Short Msg: java.lang.NullPointerException
// Long Msg: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.View.getContext()' on a null object reference
// Build Label: Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/4088240:userdebug/test-keys
// Build Changelist: 4088240
// Build Time: 1497047463000
// java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.View.getContext()' on a null object reference
//  at app.librenews.io.librenews.views.SettingsActivityFragment.onSharedPreferenceChanged(SettingsActivityFragment.java:26)
//  at android.app.SharedPreferencesImpl$EditorImpl.notifyListeners(SharedPreferencesImpl.java:479)
//  at android.app.SharedPreferencesImpl$EditorImpl.apply(SharedPreferencesImpl.java:387)
//  at android.preference.Preference.tryCommit(Preference.java:1415)
//  at android.preference.Preference.persistBoolean(Preference.java:1681)
//  at android.preference.TwoStatePreference.setChecked(TwoStatePreference.java:81)
//  at android.preference.TwoStatePreference.onClick(TwoStatePreference.java:66)
//  at android.preference.Preference.performClick(Preference.java:994)
//  at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:214)
//  at android.widget.AdapterView.performItemClick(AdapterView.java:310)
//  at android.widget.AbsListView.performItemClick(AbsListView.java:1145)
//  at android.widget.AbsListView$PerformClick.run(AbsListView.java:3042)
//  at android.widget.AbsListView$3.run(AbsListView.java:3879)
//  at android.os.Handler.handleCallback(Handler.java:739)
//  at android.os.Handler.dispatchMessage(Handler.java:95)
//  at android.os.Looper.loop(Looper.java:148)
//  at android.app.ActivityThread.main(ActivityThread.java:5417)
//  at java.lang.reflect.Method.invoke(Native Method)
//  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
//  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
//