【问题标题】:startActivityForResult with google play games intent returning to wrong activitystartActivityForResult 与谷歌玩游戏意图返回错误的活动
【发布时间】:2017-01-28 21:13:23
【问题描述】:

当我对 google play 游戏库中的任何内容(选择玩家、排行榜、成就)使用 startActivityForResult 并且该活动返回时,它会返回到手机的操作系统屏幕。这在我之前根本没有发生过,但现在它确实发生了只有在没有附加调试器时才会发生

我使用的是 xamarin,因此下面的 C# 代码:

StartActivityForResult(GamesClass.Achievements.GetAchievementsIntent(mGoogleApiClient),
                    REQUEST_ACHIEVEMENTS);

...

protected override void OnActivityResult(int requestCode, Result resultCode,
                             Intent intent)
    {
        //This does not get hit
        Logger.Debug(TAG, "OnActivityResult()");
    }

什么?

【问题讨论】:

    标签: android android-activity xamarin google-play-games


    【解决方案1】:

    尝试开始您自己的活动以获得结果,行为是否相同?

    检查您尝试开始的活动是否未声明为 noHistory=true(并且未通过带有此标志的意图启动)。

    【讨论】:

    • 还没有机会检查这个,但我会的。
    猜你喜欢
    • 1970-01-01
    • 2017-11-13
    • 1970-01-01
    • 1970-01-01
    • 2016-06-26
    • 2020-03-25
    • 2018-08-04
    • 2020-05-02
    • 2018-02-09
    相关资源
    最近更新 更多