Search code examples
androidaccelerometer

When a phone call comes , does the accelerometer stops reading in Android phones?


I am developing an app which writes accelerometer reading in a file every second. My android phone does not has a service provider so I cant check it.

When a call comes, will the accelerometer stop recording ??


Solution

  • Not if it's running in a Service or on a AsyncTask. When you are running the accelerometer on the UI Thread it will be stopped by the Activitys onPause() method but if you run it on a different thread it will not stop.