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

NullPointerException (NPE) in com.pheelicks.app.MainActivity #12

Open
danilo04 opened this issue Aug 20, 2014 · 0 comments
Open

NullPointerException (NPE) in com.pheelicks.app.MainActivity #12

danilo04 opened this issue Aug 20, 2014 · 0 comments

Comments

@danilo04
Copy link

I have implemented an static analysis tool for finding bugs in Android apps and I have found a NullPointerException (NPE) in the following class of your app:

  • com.pheelicks.app.MainActivity

What steps will reproduce the problem?

  1. Open the app and stay in the main activity.
  2. Tab the home button and before the window closes, tab the Start or Stop button in the menu.

This will create a NPE in the activity. It is worth to mention that there are other scenarios in which this bug can be seen. For example, if the user receives a phone call, but before the phone call activity takes the foreground, the user tabs the Start or Stop button. This creates a race condition between the callbacks onPause and startPressed (onPause is called before startPressed). Other apps have had this problem as you can see in bug found in MyTracks [1].

What is the expected output? What do you see instead?
The app crashes. The app must not crash and maintain the same state when the user comeback to the app.

What version of the product are you using? On what operating system?
1.0 on a Samsung S4 Mini with Android 4.2.2.

Please provide any additional information below.
To fix this problem just check the mPlayer is not null or use a flag to know when a cleanup has been made.

[1] https://code.google.com/p/mytracks/issues/detail?id=741&can=1&q=status%3AFixed&sort=id&colspec=ID%20Type%20Component%20Status%20Priority%20Targeting%20Work%20Stars%20Owner%20Summary&start=200

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

No branches or pull requests

1 participant