Skip to content

Crash when back button pressed from NearbyListFragment.java #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
misaochan opened this issue Sep 5, 2016 · 6 comments
Closed

Crash when back button pressed from NearbyListFragment.java #258

misaochan opened this issue Sep 5, 2016 · 6 comments

Comments

@misaochan
Copy link
Member

@nicolas-raoul , I guess this was when you pressed the back button during loading of the page?

USER_COMMENT=back from nearby
ANDROID_VERSION=6.0.1
APP_VERSION_NAME=1.27
BRAND=google
PHONE_MODEL=Nexus 5
CUSTOM_DATA=
STACK_TRACE=java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.app.FragmentActivity.setRequestedOrientation(int)' on a null object reference
at fr.free.nrw.commons.nearby.NearbyListFragment.unlockScreenOrientation(NearbyListFragment.java:168)
at fr.free.nrw.commons.nearby.NearbyListFragment.access$700(NearbyListFragment.java:35)
at fr.free.nrw.commons.nearby.NearbyListFragment$getNearbyPlaces.onPostExecute(NearbyListFragment.java:127)
at fr.free.nrw.commons.nearby.NearbyListFragment$getNearbyPlaces.onPostExecute(NearbyListFragment.java:104)
at android.os.AsyncTask.finish(AsyncTask.java:651)
at android.os.AsyncTask.-wrap1(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
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)

@nicolas-raoul
Copy link
Member

I actually pressed back after experiencing the double text problem for the first time, which means the list was loaded.

@misaochan
Copy link
Member Author

Hm, the issue seems to be caused by the unlockScreenOrientation method that I needed to use to lock the screen during loading and unlock it after loading (to prevent crash when screen config changes during AsyncTask loading). I wonder if it would be okay to lock the screen in portrait throughout the entire time the user is on the Nearby activity? Would people need to be able to view it in landscape? (Personally I think landscape is terrible for viewing of the list since you get so few rows and most titles aren't long enough to cause an issue in portrait, but others might feel differently?)

@nicolas-raoul
Copy link
Member

not optimal for tablet users, but better than crashing?

On Sep 5, 2016 23:20, "Josephine Lim" notifications@github.com wrote:

Hm, the issue seems to be caused by the unlockScreenOrientation method
that I needed to use to lock the screen during loading and unlock it after
loading (to prevent crash when screen config changes during AsyncTask
loading). I wonder if it would be okay to lock the screen in portrait
throughout the entire time the user is on the Nearby activity? Would people
need to be able to view it in landscape? (Personally I think landscape is
terrible for viewing of the list since you get so few rows and most titles
aren't long enough to cause an issue in portrait, but others might feel
differently?)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#258 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGFBrBFPBuK44EK4il-HKdEvoTSckfKks5qnCUhgaJpZM4J1E_Q
.

@misaochan
Copy link
Member Author

I've switched to a different method of handling screen config changes, while working on the fix for #257 (it no longer locks the screen during loading, but retains the fragment). Hopefully that will solve this issue as well.

@misaochan misaochan reopened this Sep 14, 2016
@misaochan
Copy link
Member Author

Has this issue been encountered again after the fix?

@nicolas-raoul
Copy link
Member

Not anymore :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants