Skip to content

Crashes when toggling activities when sound is enabled #138

@netmackan

Description

@netmackan

Describe the bug
The app crashes when starting or stopping activities after being away from the main view.

To Reproduce
Steps to reproduce the behavior:

  1. Make sound is enabled in Settings of ATimeTracker.
  2. Go to Android main view/screen (i.e. making sure ATimeTracker is not in the foreground).
  3. Start ATimeTracker.
  4. Start or stop an existing activity

Expected behavior
The activity state changes.

Actual behavior
The app crashes.

Smartphone (please complete the following information):

  • Samsung Galaxy S5
  • OS: Android 9 (LineageOS)

Additional context
From adb logcat:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference
 	at com.markuspage.android.atimetracker.Activities.onListItemClick(Activities.java:1234)
 	at android.app.ListActivity$2.onItemClick(ListActivity.java:319)
 	at android.widget.AdapterView.performItemClick(AdapterView.java:318)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions