0
[BroadcastReceiver(Exported=true, Enabled=true)]
[IntentFilter (new string[]
{
"intent.action.ApiAiResponse"
})]
public class ApiAiVoiceReceiver : BroadcastReceiver
{
public const string ACTION = "intent.action.ApiAiResponse";
public const string ACTION_KEY = "intent.key.action";
public const string PARAMETERS_KEY = "intent.key.parameters";
public override void OnReceive(Context context, Intent intent)
{
if (intent.Action.Equals(ACTION))
{
Toast.MakeText(context, intent.GetStringExtra(ACTION_KEY), ToastLength.Long);
} else
Toast.MakeText(context, "", ToastLength.Long);
}
からの放送を受信できない私は、コマンドを呼び出そうとしました。私はいくつかの設定が欠けていますか?これは、このアプリケーションの外部から呼び出される必要があります。BroadcastReceiverが正しい行動の意図