Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit e55e22b

Browse files
authored
Merge pull request #7 from phanirithvij/patch-1
getContext is the correct method.
2 parents ea320a9 + 91cbbba commit e55e22b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: sensors/ex2_boxes/ex2_boxes.pde

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void setup() {
3030
fullScreen(P2D);
3131
orientation(PORTRAIT);
3232

33-
context = getActivity();
33+
context = getContext();
3434
manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
3535
sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
3636
listener = new AccelerometerListener();
@@ -95,4 +95,4 @@ class AccelerometerListener implements SensorEventListener {
9595
}
9696
public void onAccuracyChanged(Sensor sensor, int accuracy) {
9797
}
98-
}
98+
}

0 commit comments

Comments
 (0)