Supposedly, when accessing the "Compass Prayer" feature in landscape mode there is no error.
Actual behavior
First of all, I access the "Compass Prayer" feature, then I change the rotation from portrait to landscape mode, suddenly the app will return to the home page and will crash and exit by itself.
How to reproduce
Install the application
Open the app
Go to "Prayer Compass" feature
Next turn the screen rotation into landscape mode, then you will find the error as I experienced.
05-16 20:10:13.218 30974 30974 E AndroidRuntime: FATAL EXCEPTION: main
05-16 20:10:13.218 30974 30974 E AndroidRuntime: Process: com.metinkale.prayer, PID: 30974
05-16 20:10:13.218 30974 30974 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at android.widget.Toast.<init>(Toast.java:102)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at android.widget.Toast.makeText(Toast.java:266)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at com.metinkale.prayerapp.compass.CompassFragment.h(CompassFragment.java:201)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at com.metinkale.prayerapp.compass.CompassFragment.a(CompassFragment.java:67)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at com.metinkale.prayerapp.compass.CompassFragment$1$1.run(CompassFragment.java:222)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:742)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5527)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
05-16 20:10:13.218 30974 30974 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
05-16 20:10:13.220 30974 30974 E MQSEventManagerDelegate: failed to get MQSService.
Expected behavior
Supposedly, when accessing the "Compass Prayer" feature in landscape mode there is no error.
Actual behavior
First of all, I access the "Compass Prayer" feature, then I change the rotation from portrait to landscape mode, suddenly the app will return to the home page and will crash and exit by itself.
How to reproduce
Recording Of The Bug
https://www.youtube.com/watch?v=CE-fJUuJ8tM
Logcat