Search code examples
androidandroid-intentandroid-tvamazon-fire-tv

Listen to Intent changes


I´m currently launching an Amazon FireTV app via the dial protocol with a parameter. This parameter can be accessed in the onCreate() by an intent like this:

Intent intent = getIntent();
paramter = intent.getStringExtra("com.amazon.extra.DIAL_PARAM");

Is there some way to know, if this intent changes while the FireTV app is running, like a listener? I know, this could be done with a while loop constantly checking if the parameter changed, but this seems not to be a good solution. Any ideas?


Solution

  • You are looking for onNewIntent of Activity, that will trigger each time the Activity receives a new Intent.

    This works exactly the same as for standard Android.