metinkale38 / prayer-times-android

A useful Application with a set of tools needed by every muslim.
https://play.google.com/store/apps/details?id=com.metinkale.prayer
Apache License 2.0
239 stars 105 forks source link

The app crashes and exits by itself when changing to landscape mode in the "Prayer Compass" feature #119

Closed ahyar92 closed 4 years ago

ahyar92 commented 6 years ago

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

  1. Install the application
  2. Open the app
  3. Go to "Prayer Compass" feature
  4. Next turn the screen rotation into landscape mode, then you will find the error as I experienced.

Recording Of The Bug

https://www.youtube.com/watch?v=CE-fJUuJ8tM

Logcat

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.