Search code examples
javaandroidmapactivity

onPause() function does not work when extend MapActivity


When I extend MapActivity instead of Activity, I can not use onPause(), onResume(), onRestart() functions. When I create protected void onPause(), there is an error for force close when I click home button. I tried ActivityGroup and it doesn't work too. What should I do?


Solution

  • Did you forget to call super.onPause(), super.onResume(), etc.?

    Quote from the documentation:

    Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.