1

I use monogame for developing crossplatform game. For android I have one Activity:

[Activity (Label = "GameName", 
    MainLauncher = true,
    Icon = "@drawable/icon",
    Theme = "@style/Theme.Splash",
    AlwaysRetainTaskState = true,
    LaunchMode = Android.Content.PM.LaunchMode.SingleInstance,
    ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation |
    Android.Content.PM.ConfigChanges.KeyboardHidden |
    Android.Content.PM.ConfigChanges.Keyboard, 
    ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait)]
public class Activity1 : AndroidGameActivity
{
    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);         
        Game1.Activity = this;
        var _game = new Game1 ();
        SetContentView (_game.Window);
        _game.Run ();
    }
}

And I also would like to use Xamarin.Auth for Facebook integration. So, I'm doing next on onButtonTap:

var auth = new OAuth2Authenticator (
    clientId: "here_is_my_facebookApp_id",
    scope: "",
    authorizeUrl: new Uri ("https://m.facebook.com/dialog/oauth/"),
    redirectUrl: new Uri ("http://www.facebook.com/connect/login_success.html"));

auth.AllowCancel = true;
auth.Completed += (s, ee) => {
                                 // some code, does not matter what
                             };

var intent = _auth.GetUI (activity);
activity.StartActivity (intent);

activity is my Activity1. As a result I have empty page after onButtonTap. I have used the same code in other android project (without monogame) and it works fine. But if I use it with monogame project then result is an empty page.

Can anybody help to make it work?

Justin Wood
  • 9,941
  • 2
  • 33
  • 46
Unknown User
  • 78
  • 1
  • 7
  • This is not really my area of knowledge but after looking at your code, could it be as simple as creating another Activity instead of using the same one you use for MonoGame? – craftworkgames Mar 03 '14 at 04:28
  • I already try to do that. I made another activity (not monogame) that calls activity for facebook authentification. And start it from Monogame's activity. Result the same. – Unknown User Mar 03 '14 at 05:36

0 Answers0