Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Refresh Image Source with timer

$
0
0

In my ContentPage i have only an image. I need to refresh this image's source from an uri every five seconds. So I just wrote this.

            Device.StartTimer(new TimeSpan(0, 0, 5), () =>
            {

                Device.BeginInvokeOnMainThread(() =>
                {
                    camPhoto.Source = ImageSource.FromUri(new Uri(urilink));
                });
                return true; 
            });

Timer does work, every five seconds. (My link doesn't change but the resulting image of the link does change every 5 seconds.) But the image doesn't change after the first image fetching. Android, UWP behaves the same way. How can I fix this?


Viewing all articles
Browse latest Browse all 89864

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>