Fix #3712 double check if activity is alive
This commit is contained in:
parent
f454b12d07
commit
d6a53c43c2
1 changed files with 5 additions and 1 deletions
|
@ -497,6 +497,10 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Void res) {
|
protected void onPostExecute(Void res) {
|
||||||
hideProgressBar();
|
hideProgressBar();
|
||||||
|
if(getActivity() == null) {
|
||||||
|
// user quit application
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (src != null && dst != null) {
|
if (src != null && dst != null) {
|
||||||
Algorithms.fileCopy(src, dst);
|
Algorithms.fileCopy(src, dst);
|
||||||
|
@ -518,7 +522,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
sendIntent.setType("text/plain");
|
sendIntent.setType("text/plain");
|
||||||
startActivity(sendIntent);
|
startActivity(sendIntent);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//Toast.makeText(getActivity(), "Error sharing favorites: " + e.getMessage(), Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), "Error sharing favorites: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue