My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 67 attachment: compassError.patch (929 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- MixView.java 2011-01-18 13:31:05.582164000 +0100
+++ MixView.java 2011-01-18 13:29:45.162163998 +0100
@@ -104,6 +104,8 @@
private WakeLock mWakeLock;

private boolean fError;
+
+ private int compassErrorDisplayed = 0;

private String zoomLevel;
private int zoomProgress;
@@ -732,8 +734,11 @@
}

public void onAccuracyChanged(Sensor sensor, int accuracy) {
- if(sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD && accuracy==SensorManager.SENSOR_STATUS_UNRELIABLE) {
- Toast.makeText(mixContext, "Compass data unreliable. Please recalibrate compass.", Toast.LENGTH_LONG).show();
+ if(sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD && accuracy==SensorManager.SENSOR_STATUS_UNRELIABLE && compassErrorDisplayed == 0) {
+ for(int i = 0; i <2; i++) {
+ Toast.makeText(mixContext, "Compass data unreliable. Please recalibrate compass.", Toast.LENGTH_LONG).show();
+ }
+ compassErrorDisplayed++;
}
}

Powered by Google Project Hosting