Use getExternalCacheDir() instead of getCacheDir()

This commit is contained in:
Alexander Sytnyk 2017-12-11 14:08:22 +02:00
parent ba1b578f5c
commit 5afbbdc719

View file

@ -470,8 +470,13 @@ public class NotesFragment extends OsmAndListFragment {
startActivity(Intent.createChooser(intent, getString(R.string.share_note)));
}
@Nullable
private File generateGPXForRecordings(Set<Recording> selected) {
File tmpFile = new File(getActivity().getCacheDir(), "share/noteLocations.gpx");
File externalCacheDir = getActivity().getExternalCacheDir();
if (externalCacheDir == null) {
return null;
}
File tmpFile = new File(externalCacheDir, "share/noteLocations.gpx");
tmpFile.getParentFile().mkdirs();
GPXFile file = new GPXFile();
for (Recording r : selected) {