I am developing android app, with feature of casting to Fire Stick. While connecting to it I often get TimeoutException:
FlingMediaRouteProvider , message: Error attempting to add status listener , throwable message: throwable class: java.util.concurrent.TimeoutException java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:206) atFlingMediaRouteProvider$FlingRouteController .setItemUpdateReceiver(FlingMediaRouteProvider.java:521)
It is line below:
I was debugging that problem without success for long time. One thing I have noticed, is that this problem repeats. When I get it once, I get it every time when I try to connect again.
It disappears only in 2 cases:
- after some time passes,
- when I reset Fire Stick (unplug it from and plug it into power supply again)
Sometimes I also get similar TimeoutException, but while removing status listener.
Does someone have any experience with similar issues? How can I fix it?