アプリのページからタイルを作成しようとしていますが、正常に動作します。
ShellTile.Create(new Uri(uri, UriKind.Relative), tileData, true);
アプリを廃棄してからアプリをフォアグラウンドに戻し、タイルを作成しようとすると、次のエラー メッセージが表示されます。
System.InvalidOperationException: Tiles can only be created when the application is in the foreground
at Microsoft.Phone.Shell.SafeNativeMethods.ThrowExceptionFromHResult(Int32 hr, Exception defaultException)
at Microsoft.Phone.Shell.ShellTile.Create(Uri navigationUri, ShellTileData initialData, Boolean supportsWideTile)
かなりローエンドのデバイスでのみ発生します
これを修正する方法はありますか?
edit : これは、タイルの作成を呼び出す関数です。
private void OnPinToStartButtonClicked(object sender, RoutedEventArgs e)
{
if (MyRouteTileHelper.FindCommuteTile() == null)
{
LiveTileHelper.CreateEmptyTile();
}
}
およびxaml:
<Button x:Name="PinToStartButton" Click="OnPinToStartButtonClicked" />