Comments (5)
👍
from seismic.
Use
sd.stop();
sensorManager.unregisterListener(sd);
in your onDestroy Override method
from seismic.
I put
sd.stop();
inonPause()
,onDestroy()
, andonBackPressed()
but when I leave the application and shake the device on my homescreen for example it still performs the specified action.
Solved for me though!
Thanks!
from seismic.
from seismic.
@timbremer I know I'm late to the party but this may help others. I had the same issue and solved it by moving the start
process of ShakeDetector
to onResume
instead of onCreate
.
override fun onResume() {
shakeDetector.start(sensorManager)
super.onResume()
}
And I stop the ShakeDetector
and unregister listeners of SensorManager
when the activity gets paused.
override fun onPause() {
if (BuildConfig.DEBUG) {
shakeDetector.stop()
sensorManager.unregisterListener(shakeDetector)
}
super.onPause()
}
from seismic.
Related Issues (12)
- Incorrect package in class "Demo" HOT 2
- Purge results in less then MIN_QUEUE_SIZE items HOT 1
- Not compatible with Galaxy S5? HOT 2
- memory leak HOT 4
- Can i increase the number of shakes per second?
- Would be nice to have ProGuard documentation. HOT 1
- Permission HIGH_SAMPLING_RATE_SENSORS required when targeting Android 12 HOT 3
- Seismic HOT 1
- Shake is not working on motorola HOT 1
- Set motion sensitivity HOT 1
- Add method to change window size HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seismic.