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

APDS9960: App crashes when trying to read data from sensor #2608

Open
AsCress opened this issue Jan 9, 2025 · 0 comments
Open

APDS9960: App crashes when trying to read data from sensor #2608

AsCress opened this issue Jan 9, 2025 · 0 comments
Labels
Bug Unexpected problem or unintended behavior in app Instrument: Sensors

Comments

@AsCress
Copy link
Collaborator

AsCress commented Jan 9, 2025

Actual Behaviour
The app crashes whenever one tries to read data from the APDS9960 sensor.

Expected Behaviour
The app shouldn't crash in any circumstances.

Steps to reproduce it

  1. Connect the APDS9960 to the PSLab and the PSLab device to the mobile.
  2. Open SensorActivity and try to read data from the APDS9960.
  3. The app crashes.

LogCat for the issue

Process: io.pslab, PID: 25865 android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
                                                                                                    	at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:8282)
                                                                                                    	at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1445)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:380)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.widget.ScrollView.requestLayout(ScrollView.java:1646)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.view.View.requestLayout(View.java:24525)
                                                                                                    	at android.widget.TextView.checkForRelayout(TextView.java:9725)
                                                                                                    	at android.widget.TextView.setText(TextView.java:6296)
                                                                                                    	at android.widget.TextView.setText(TextView.java:6124)
                                                                                                    	at android.widget.TextView.setText(TextView.java:6076)
                                                                                                    	at io.pslab.sensors.SensorAPDS9960$SensorDataFetch.updateUi(SensorAPDS9960.java:162)
                                                                                                    	at io.pslab.sensors.AbstractSensorActivity$SensorDataFetch.execute(AbstractSensorActivity.java:342)
                                                                                                    	at io.pslab.sensors.AbstractSensorActivity.lambda$getTimerTask$0(AbstractSensorActivity.java:143)
                                                                                                    	at io.pslab.sensors.AbstractSensorActivity.$r8$lambda$CtbQmazQbDhPICCZGZ_trI5o3R8(Unknown Source:0)
                                                                                                    	at io.pslab.sensors.AbstractSensorActivity$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:883)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    	at android.os.Looper.loop(Looper.java:241)
                                                                                                    	at android.os.HandlerThread.run(HandlerThread.java:67)

Screenshots of the issue
A screen recording demonstrating the issue:

Screen_recording_20250109_221227.mp4

Would you like to work on the issue?
Maybe, but I guess @marcnause knows better about this 😂.
This seems to have be caused by 3d66bf5 merged in #2605.

@AsCress AsCress added Instrument: Sensors Bug Unexpected problem or unintended behavior in app labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Unexpected problem or unintended behavior in app Instrument: Sensors
Projects
None yet
Development

No branches or pull requests

1 participant