| CLASS info |
| public class ActivityIdentification |
| Entry for calling activity identification, which is used to obtain the ActivityIdentificationService instance. |
| Return type | Method name |
| static ActivityIdentificationService | getService(Activity activity) |
| static ActivityIdentificationService | getService(Context context) |
| 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 name | Parameter desc |
| activity | Activity. |
Return
| type | desc |
| ActivityIdentificationService | ActivityIdentificationService 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 name | Parameter desc |
| context | Context. |
Return
| type | desc |
| ActivityIdentificationService | ActivityIdentificationService instance obtained based on the context. |