forked from upstream-mirrors/OpenTracks
Removed duplicate registration of images at MediaScanner.
This commit is contained in:
@@ -107,6 +107,7 @@ public class TrackDetailActivity extends AbstractListActivity implements ChooseA
|
|||||||
WaypointCreationRequest waypointCreationRequest = new WaypointCreationRequest(WaypointType.WAYPOINT, false, null, null, null, null, photoUri.toString());
|
WaypointCreationRequest waypointCreationRequest = new WaypointCreationRequest(WaypointType.WAYPOINT, false, null, null, null, null, photoUri.toString());
|
||||||
long markerId = TrackRecordingServiceConnectionUtils.addMarker(TrackDetailActivity.this, trackRecordingServiceConnection, waypointCreationRequest);
|
long markerId = TrackRecordingServiceConnectionUtils.addMarker(TrackDetailActivity.this, trackRecordingServiceConnection, waypointCreationRequest);
|
||||||
if (markerId != -1L) {
|
if (markerId != -1L) {
|
||||||
|
//TODO: Make configurable.
|
||||||
FileUtils.updateMediaScanner(TrackDetailActivity.this, photoUri);
|
FileUtils.updateMediaScanner(TrackDetailActivity.this, photoUri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,14 +266,6 @@ public class TrackDetailActivity extends AbstractListActivity implements ChooseA
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
hasPhoto = resultCode == RESULT_OK;
|
hasPhoto = resultCode == RESULT_OK;
|
||||||
|
|
||||||
if (hasPhoto) {
|
|
||||||
//Register photo in media scanner
|
|
||||||
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
|
|
||||||
mediaScanIntent.setData(photoUri);
|
|
||||||
this.sendBroadcast(mediaScanIntent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user