Skip to content

Commit 14c3348

Browse files
committed
use getContext()
1 parent e0a819f commit 14c3348

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

wallpapers/ex2_compass/ex2_compass.pde

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@ void draw() {
5252

5353
public void onResume() {
5454
super.onResume();
55-
56-
// This works for regular apps
57-
//Context context = surface.getActivity();
58-
59-
// This for fragments:
60-
context = (Context) surface.getComponent();
55+
56+
context = surface.getContext();
6157

6258
listener = new SensorListener();
6359
manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);

0 commit comments

Comments
 (0)