[android] Removed exception throw since Activity.onDestroy isn't guaranteed to be called.

This commit is contained in:
Dmitry Yunitsky 2016-04-04 16:13:28 +03:00 committed by Alex Zolotarev
parent c143c796ab
commit 3dd79a06ca
2 changed files with 2 additions and 8 deletions

View file

@ -675,6 +675,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onDestroy()
{
// TODO move listeners attach-deattach to onStart-onStop since onDestroy isn't guaranteed.
Framework.nativeRemoveMapObjectListener();
BottomSheetHelper.free();
super.onDestroy();

View file

@ -173,7 +173,7 @@ public class RoutingController
{
cancel();
for (String map: mLastMissingMaps)
for (String map : mLastMissingMaps)
MapManager.nativeDownload(map);
if (mContainer != null)
@ -250,18 +250,11 @@ public class RoutingController
public void attach(@NonNull Container container)
{
Log.d(TAG, "attach");
if (mContainer != null)
throw new IllegalStateException("Must be detached before attach()");
mContainer = container;
}
public void detach()
{
Log.d(TAG, "detach");
mContainer = null;
mStartButton = null;
}