2011-12-21 74 views
0

我正在尝试使用提醒api但没有运气。我用来创建提醒的代码位于下方。发生的事情是,提醒没有被触发,直到我添加另一个提醒,在这一点旧的提醒立即去。我想这段代码并没有多少提示,因为它几乎是从微软的提示贴上复制粘贴的。但我不知道哪里出了问题,可以以其他方式(我将发布其他代码片段,如果您有任何建议,其中问题可能在于)提醒只在添加新提醒时执行

Reminder notification = new Reminder(""+uniqueId); 
      notification.Title = "Title"; 
      notification.Content = "Content"; 
      notification.BeginTime = DateTime.Now.AddSeconds(10); 
      notification.RecurrenceType = RecurrenceInterval.None; 
      notification.NavigationUri = new Uri("/MyPage.xaml?id=" + uniqueId, UriKind.Relative); 

      // Register the reminder with the system. 
      ScheduledActionService.Add(notification); 

回答

0

好了没有什么错的代码。仿真器系统时间设置为自动,但不知何故20分钟错误导致奇怪的行为。手动设置时间后,按预期工作。