HERE Android SDK Developer's Guide

MapActivity

The class MapActivity is a member of com.here.android.mpa.common .

Class Summary

public class MapActivity

extends java.lang.Object

An activity class for managing the resource state of the MapEngine.

Deprecated: As of SDK 3.3, replaced by MapFragment.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in MapActivity
Constructors

MapActivity ()

Method Summary

Table 2. Methods in MapActivity
Methods

protected void onCreate (Bundle savedInstanceState)

Called when an instance of the given class is created (map activity begins).

protected void onInitialized (Error error)

Called when MapEngine initialization completes.

protected void onPause ()

Called when map activity pauses (is suspended).

protected void onResume ()

Called when the given instance of map activity resumes.

Class Details

Deprecated: As of SDK 3.3, replaced by MapFragment.

An activity class for managing the resource state of the MapEngine. When onCreate(Bundle) is called, it automatically initializes the MapEngine .

Only activities that consume or use an API needs to inherit from MapActivity .

This class overrides the methods android.app.android.app.Activity#onCreate(Bundle), android.app.android.app.Activity#onResume(), and android.app.android.app.Activity#onPause() defined in android.app.android.app.Activity.

This will not work as expected if your targetSdkVersion is set to 23 and above running on device with Marshmallow and above. MapActivity initializes MapEngine before asking users for permissions resulting in a blank screen. Use MapFragment instead.

Constructor Details

MapActivity ()

Method Details

protected void onCreate (Bundle savedInstanceState)

Called when an instance of the given class is created (map activity begins). The method issues an initialization request to the MapEngine. When MapEngine initialization has completed, onInitialized(OnEngineInitListener.Error) is called.

Parameters:

  • savedInstanceState

    An object representing the previous saved state of MapActivity; used if a new instance of this class is to be recreated from a previous session.

See also:

onInitialized(Error)

protected void onInitialized (Error error)

Called when MapEngine initialization completes. User of MapActivity class can override this to detect when or if MapEngine is ready for use.

Parameters:

protected void onPause ()

Called when map activity pauses (is suspended).

protected void onResume ()

Called when the given instance of map activity resumes.