始终从 Google 意识 API 检测 Activity 中获得 ON_FOOT。如何获得子activity WALKING?

Always getting ON_FOOT from Google Awareness API Detection Activity. How to get sub-activity WALKING?

我正在使用 class DetectedActivity from the Google Awareness API。当我走路或 运行 时,我总是得到响应 ON_FOOT

例如,当我正在走路时,我想回去WALKING only but I still get ON_FOOT。我确实在文档中看到了以下注释,但它也没有说明如何获取 ON_WALKING sub-activity 信息?

The device is on a user who is walking. This is a sub-activity of ON_FOOT.

您需要使用 getProbableActivities 来获取可能活动的完整列表:而 ON_FOOT 最有可能 activity,查看第二个最有可能的 activity 会 return WALKING, RUNNING, 等等