fekracomputers / IslamicLibraryAndroid

Islamic books Library with improved features
GNU General Public License v3.0
56 stars 22 forks source link

The application crashes when accessing the "Books data directory" feature and changing screen rotation. #76

Open ahyar92 opened 6 years ago

ahyar92 commented 6 years ago

Expected behavior

Supposedly, when accessing the "Books data directory" feature and changing screen rotation, the app will not get any errors.

Actual behavior

When I go into the settings menu and click on the "Books data directory" feature, and after the "Books data directory" page appears, I change the screen rotation, and the application suddenly crashes.

How to reproduce

  1. Install and Open the app
  2. Next, go to settings menu
  3. Then click on the "Books data directory" feature, and after the "Books data directory" page is displayed, please change the screen rotation to landscape mode, then you will see the application will crash.

Environment

Tested on two devices:

DeviceAndroid Version
Xiaomi Redmi Note 5ANougat, 7.1.0
Xiaomi Redmi 4XMarshmallow, 6.0.1

Application Version: 1.4.4


Recording Of The Bug

https://www.youtube.com/watch?v=wRtxcFfm11M&feature=youtu.be

Logcat

05-30 00:58:08.345 11747 11747 E AndroidRuntime: FATAL EXCEPTION: main
05-30 00:58:08.345 11747 11747 E AndroidRuntime: Process: com.fekracomputers.islamiclibrary, PID: 11747
05-30 00:58:08.345 11747 11747 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fekracomputers.islamiclibrary/com.fekracomputers.islamiclibrary.settings.SettingsActivity}: java.lang.NullPointerException
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2741)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2802)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4621)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread.-wrap19(ActivityThread.java)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1557)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:163)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6361)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
05-30 00:58:08.345 11747 11747 E AndroidRuntime: Caused by: java.lang.NullPointerException
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at java.util.Objects.requireNonNull(Objects.java:203)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at java.util.Arrays$ArrayList.<init>(Arrays.java:3826)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at java.util.Arrays.asList(Arrays.java:3813)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.widget.ArrayAdapter.<init>(ArrayAdapter.java:139)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at com.fekracomputers.islamiclibrary.widget.DataListPreferenceDialogFragmentCompat$StorageArrayAdapter.<init>(DataListPreferenceDialogFragmentCompat.java:68)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at com.fekracomputers.islamiclibrary.widget.DataListPreferenceDialogFragmentCompat.onPrepareDialogBuilder(DataListPreferenceDialogFragmentCompat.java:35)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v7.preference.PreferenceDialogFragmentCompat.onCreateDialog(PreferenceDialogFragmentCompat.java:154)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:328)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.Fragment.performGetLayoutInflater(Fragment.java:1224)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1421)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1752)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1821)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3251)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3205)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1249)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.Activity.performStart(Activity.java:6891)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2704)
05-30 00:58:08.345 11747 11747 E AndroidRuntime:    ... 10 more