public void CheckStill() { if (activityIdentificationService == null) { activityIdentificationService = ActivityIdentification.getService(new Context()); } if (pendingIntent != null) { removeActivityTransitionUpdates(); } LocationBroadcast.SetListenActivityConversionEnabled(true); try { List transitions = new List(); activityTransition.setActivityType(103); activityTransition.setConversionType(0); transitions.add(activityTransition.build().obj); activityTransition.setActivityType(103); activityTransition.setConversionType(1); transitions.add(activityTransition.build().obj); pendingIntent = getPendingIntent(); activityTransitionRequest = new ActivityConversionRequest(transitions); Task task = activityIdentificationService.createActivityConversionUpdates(activityTransitionRequest, pendingIntent); task.addOnSuccessListener(new LocationSuccessListener((o) => { TestTip.Inst.ShowText("createActivityConversionUpdates onSuccess"); })).addOnFailureListener(new HmsFailureListener((o) => { TestTip.Inst.ShowText("createActivityConversionUpdates exception"); })); } catch (System.Exception e) { TestTip.Inst.ShowText("createActivityConversionUpdates exception:" + e.StackTrace); } }