目录

CLASS info
public class ActivityIdentification
Entry for calling activity identification, which is used to obtain the ActivityIdentificationService instance.

Public Method Summary

Return typeMethod name
static ActivityIdentificationServicegetService(Activity activity)
static ActivityIdentificationServicegetService(Context context)

Public Methods

Method
public static ActivityIdentificationService getService(Activity activity)

This API is used to create an ActivityIdentificationService instance, which is used in an activity. 

Notice:
If the input parameter is of the Activity type and an error occurs when the ActivityIdentificationService instance is used to call the location service API, the app displays the interaction UI to prompt the user to handle the error. For example, if HMS Core (APK) is not in a version required for the location service, the app displays the UI to prompt the user to update HMS Core (APK).

Parameters

Parameter nameParameter desc
activityActivity.

Return

typedesc
ActivityIdentificationServiceActivityIdentificationService instance obtained based on the activity.
Method
public static ActivityIdentificationService getService(Context context)

This API is used to create an ActivityIdentificationService instance.

Notice:
If the input parameter is not of the Activity type and an error occurs when the ActivityIdentificationService instance is used to call the location service API, the app only returns an error code but does not display the interaction UI to prompt the user to handle the error. For example, if HMS Core (APK) is not in a version required for the location service, the app returns the error code 907135003. In this case, the user needs to manually update HMS Core (APK). To show the update wizard, you are advised to pass a parameter of the Activity type instead of the Context type to create a Client instance.

Parameters

Parameter nameParameter desc
contextContext.

Return

typedesc
ActivityIdentificationServiceActivityIdentificationService instance obtained based on the context.