ybs32 / TweetMate-for-Android

will be updated irregularly.
Apache License 2.0
0 stars 0 forks source link

Crash report that "NullPointerException" in "setDropDownMenu" #90

Closed ybs32 closed 2 years ago

ybs32 commented 2 years ago

The stack trace is this.

java.lang.NullPointerException: 
  at android.view.LayoutInflater.from (LayoutInflater.java:282)
  at android.widget.ArrayAdapter.<init> (ArrayAdapter.java:213)
  at android.widget.ArrayAdapter.<init> (ArrayAdapter.java:207)
  at android.widget.ArrayAdapter.<init> (ArrayAdapter.java:165)
  at com.ybsystem.tweethub.fragments.timeline.MainListTimeline.setDropDownMenu (MainListTimeline.java)
  at com.ybsystem.tweethub.fragments.timeline.MainListTimeline.access$100 (MainListTimeline.java)
  at com.ybsystem.tweethub.fragments.timeline.MainListTimeline$2.onError (MainListTimeline.java:26)
  at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated (ObservableObserveOn.java:47)
  at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal (ObservableObserveOn.java)
  at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run (ObservableObserveOn.java)
  at io.reactivex.rxjava3.android.schedulers.HandlerScheduler$ScheduledRunnable.run (HandlerScheduler.java:2)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:223)
  at android.app.ActivityThread.main (ActivityThread.java:7887)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:981)
ybs32 commented 2 years ago

Probably the same problem as this one. https://stackoverflow.com/questions/26093600/nullpointerexception-layoutinflater-fromcontext-fragment-android

Source code https://github.com/ybs32/TweetMate-for-Android/blob/a60db9a69b28c71d7873a74aa9537be70afa31ad/TweetMate/src/main/java/com/ybsystem/tweetmate/fragments/timeline/MainListTimeline.java#L207-L209

ybs32 commented 2 years ago

Priority is "Medium".

If users get this error, it can be very stressful, they not being able to open the app and see the timeline,

but in most cases, "Activity" is created at this time, and this problem seems to occur infinitely rarely.

ybs32 commented 2 years ago

Done.