如何使用Xamarin点击推送通知时打开第二个活动?

时间:2017-07-17 13:15:14

标签: android android-pendingintent

我正在使用Xamarin实现推送通知。推送通知正常,我可以收到推送通知。当我点击通知消息时,相应的页面没有打开,而是加载pop显示很长时间。我在android项目中单击通知时使用以下代码打开活动。我想从我的新活动类中调用便携式项目中的方法。

Intent intent = new Intent(context, typeof(Push));
intent.AddFlags(ActivityFlags.ClearTop);
PendingIntent activity = PendingIntent.GetActivity(context, 0, intent, 0);

我在便携式项目中调用了视图,如下所示

public void test(parameters)
{
   await Navigation.PushModalAsync(new DescriptionPage(tileGrid, 
      m_eBookShortName, m_eBookName, false, downloadImage, deleteImageIcon, 
      m_downloadProgressbar));
}

我的代码中有什么问题?如何在点击推送通知时启动xaml视图?

0 个答案:

没有答案