简体   繁体   中英

live tile is not updating in Windows Phone

i am developing a windows phone app where application has an option to pin the application to home screen. And i am using ShellTileSchedule class to do schedule the update periodically. Some reason my app is not pushing any update to tile. My app data is completely local, no data is coming from outside.

In my tile update, i am not updating any image on the lile, but only changing the data to display.

 foreach (ShellTile tile in ShellTile.ActiveTiles)
 {
            IconicTileData tileData = GetTileData();

            tileSchedule = new ShellTileSchedule(tile, tileData);
            tileSchedule.Interval = UpdateInterval.EveryHour;
            tileSchedule.Recurrence = UpdateRecurrence.Interval;
            tileSchedule.Count=GetUserData();
            tileSchedule.StartTime = DateTime.Now;
            tileSchedule.Start();

            tile.Update(tileData);
}

Any help in this regard? Or do i need to background agent to update the tile?

ShellTileSchedule can only pull images off the web, not from the phone itself. This is one of the limitations of ShellTileSchedule. If you want to set background images to resources on the phone, look at using push notifications instead.

Source: http://www.silverlightshow.net/news/WP7-Using-ShellTileSchedule-to-update-your-app-s-Live-Tile-background.aspx

Shouldn't you be setting a ShellTileSchedule.RemoteImageUri somewhere? I mean, that's kinda what ShellTileSchedule is there for, to update your tile image from a remote Uri on a regular interval... See sample of how to use this class for secondary tiles here .

You have to fill the properties of IconicTileData. In your sample you just create empty data structure and use it for the schedule, that won't work. I use it like this:

IconicTileData newTileData = new IconicTileData
{
    Title = SharedResources.AppName,
    Count = BatteryHelper.BateryLevel,
    SmallIconImage = new Uri(@"/Assets/IconicSmall.png", UriKind.Relative),
    IconImage = new Uri(@"/Assets/IconicMedium.png", UriKind.Relative),
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM