В настоящее время я пытаюсь протестировать код API Google Transition, и у меня возникают проблемы с трансляцией на эмулируемое устройство в Android Studio. Я использую
adb shell am broadcast -a com.google.gservices.intent.action.GSERVICES_OVERRIDE -e 'location:mock_activity_type' 'WALKING'
иЯ получаю обратно: Broadcast completed: result=0
мой манифест настроен на:
<receiver android:name=".TransitionRecognitionReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="transitionrecognitionapp.TRANSITION_RECOGNITION" />
<action android:name="com.google.gservices.intent.action.GSERVICES_OVERRIDE"/>`
</intent-filter>
</receiver>
Любая помощь будет оценена
РЕДАКТИРОВАТЬ : Итак, у меня есть:
override fun onReceive(context: Context?, intent: Intent?) {
mContext = context!!
Log.d(TAG, "onReceive")
if (ActivityTransitionResult.hasResult(intent)) {
var result = ActivityTransitionResult.extractResult(intent)
if (result != null) {
processTransitionResult(result)
}
}
}
И когда я запускаю команду, я получаю
onRecieve
в журналах - однако на самом деле она все еще не обновляет действие