【问题标题】:Open Xamarin.Forms Page from Xamarin.Android从 Xamarin.Android 打开 Xamarin.Forms 页面
【发布时间】:2018-04-04 13:40:06
【问题描述】:

我在 Xamarin.Android 中接收 Firebase 推送通知。 接收时,我想打开 Xamarin.Forms 应用程序的特定内容页面。

我用

Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(new ShowAlert(null));

“ShowAlert”是我要打开的页面。

“ShowAlert”的构造函数被调用执行,但页面没有被打开。缺少什么?

感谢您的帮助!

【问题讨论】:

  • 你在初始化 Xamarin Forms Forms.Init(this, bundle);
  • 是的,我愿意。在 MainActivity (Xamarin.Andoid) 的“onCreate”中。
  • 当您的应用程序已经运行时推送通知是否进来?我想知道在应用程序未运行时是否未运行主要活动以发送推送通知。
  • 是的,应用程序正在运行并且在前台。
  • "Xamarin.Forms.Device.BeginInvokeOnMainThread" 是解决方案!非常感谢!

标签: xamarin xamarin.forms


【解决方案1】:

你是从 UI 线程调用 PushAsync 吗? Device.BeginInvokeOnUIThread .

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-13
    • 1970-01-01
    • 2022-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多