forked from upstream-mirrors/OpenTracks
Don't trap runtime exceptions.
This commit is contained in:
@@ -562,9 +562,6 @@ public class ChartActivity extends Activity implements
|
|||||||
}
|
}
|
||||||
lastSeenLocationId = track.getStartId();
|
lastSeenLocationId = track.getStartId();
|
||||||
final ArrayList<double[]> theData = readPointsToList(track);
|
final ArrayList<double[]> theData = readPointsToList(track);
|
||||||
if (theData == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
chartView.setDataPoints(theData);
|
chartView.setDataPoints(theData);
|
||||||
@@ -582,11 +579,7 @@ public class ChartActivity extends Activity implements
|
|||||||
Log.w(MyTracksConstants.TAG, "MyTracks: track not found");
|
Log.w(MyTracksConstants.TAG, "MyTracks: track not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final ArrayList<double[]> theData = readPointsToList(track);
|
chartView.addDataPoints(readPointsToList(track));
|
||||||
if (theData == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
chartView.addDataPoints(theData);
|
|
||||||
uiHandler.post(new Runnable() {
|
uiHandler.post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
chartView.invalidate();
|
chartView.invalidate();
|
||||||
@@ -613,7 +606,7 @@ public class ChartActivity extends Activity implements
|
|||||||
/**
|
/**
|
||||||
* Read all of the points to a list.
|
* Read all of the points to a list.
|
||||||
* @param track The track which will be displayed.
|
* @param track The track which will be displayed.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private ArrayList<double[]> readPointsToList(Track track) {
|
private ArrayList<double[]> readPointsToList(Track track) {
|
||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
@@ -655,9 +648,6 @@ public class ChartActivity extends Activity implements
|
|||||||
cursor = null;
|
cursor = null;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (RuntimeException e) {
|
|
||||||
Log.w(MyTracksConstants.TAG, "Caught an unexpected exception.", e);
|
|
||||||
return null;
|
|
||||||
} finally {
|
} finally {
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user