Skip to content
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

Crash caused by rotating the screen on the "manage data" page #295

Open
sjl872964789 opened this issue Aug 15, 2020 · 4 comments
Open

Crash caused by rotating the screen on the "manage data" page #295

sjl872964789 opened this issue Aug 15, 2020 · 4 comments

Comments

@sjl872964789
Copy link

Describe the bug
Crash caused by rotating the screen on the "manage data" page

To Reproduce
Steps to reproduce the behavior:

  1. Install a2dp and open app
  2. Click three points in the upper right corner
  3. Click "manage data"
  4. Click "import database from sd card
  5. Rotate screen
  6. Back
  7. Crash

Expected behavior
Not crash

Smartphone (please complete the following information):

  • Device: HUAWEI nova 5 pro
  • OS: EMUI 9.1.1
  • Rooted: No
  • Version: v2.13.0.4

Additional context
logcat:

: java.lang.RuntimeException: An error occurred while executing doInBackground()
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at android.os.AsyncTask$4.done(AsyncTask.java:399)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:919)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at android.widget.Toast.<init>(Toast.java:121)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at android.widget.Toast.makeText(Toast.java:286)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at android.widget.Toast.makeText(Toast.java:276)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at a2dp.Vol.DeviceDB.selectAll(DeviceDB.java:247)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at a2dp.Vol.ManageData$SelectDataTask.doInBackground(ManageData.java:398)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at a2dp.Vol.ManageData$SelectDataTask.doInBackground(ManageData.java:385)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at android.os.AsyncTask$3.call(AsyncTask.java:378)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
08-08 05:19:06.505  7795  8103 E AndroidRuntime: 	... 4 more

record:
ezgif com-video-to-gif (3)

@jroal
Copy link
Owner

jroal commented Aug 15, 2020

Like all the other issues around screen rotation, I consider them all very low priority. This app is a utility that you set up once and forget. The user does not spend much time in the UI. I am just an amateur developer and as you can see, UI development is not my thing. If someone want to figure out what I need to change and provide the fix here, fine I will integrate it. I do not plan to spend any time working on screen rotation issues though.

@uschindler
Copy link
Collaborator

I would just disable screen rotation on the activity config. Problem solved. 👍🏻

@jroal
Copy link
Owner

jroal commented Aug 15, 2020

I would just disable screen rotation on the activity config. Problem solved. 👍🏻

Perfect! That is now my plan for all the rotation issues. I will simply block all rotations as they are not needed for this app anyway. Everything will now be forced portrait.

@sjl872964789
Copy link
Author

Thanks for your quick fix, at least now a2dp will not crash frequently due to accidental rotation, cheers!

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

3 participants