Advertisement
Guest User

ex

a guest
Oct 1st, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1.  
  2.  
  3. //somewhere in your sensor class {
  4.  
  5.  
  6. public interface SensorInputObserver {
  7.     public void onNewSensorValues(*put primitives here, not objects, or reuse the objects you put here);
  8. }
  9.  
  10. SensorInputObserver mSensorInputObserver;
  11.  
  12.  
  13. public void processSensorInput() {
  14.     ...
  15.  
  16.     //once finished with processing, pick relevant values and
  17.     if (mSensorInputObserver != null) {
  18.         mSensorInputObserver.onNewSensorValues(***);
  19.     }
  20. }
  21.  
  22.  
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement