UnityPlayerActivity equivalent of R.layout.main?

I’m trying to see if FBRocket (android api for facebook) will cooperate with Unity. I’m stuck at the login level because it specifically wants as an input parameter:

returnWindow - The resource ID of the window you want to return to once the [login is complete] (e.g. R.layout.main).

I’ve been trying various ways to get something to use for that resourceId from UnityPlayerActivity and I can’t seem to find anything. Anybody have any suggestions?

BTW - using just the default android-facebook-api was much easier (you can add a layout similar to the AdMob method and grab the context instead). I was just trying to use FBRocket because it seems more full featured, but this should get me what I need.

That’s because there is no layout resource id; we simply don’t use resources for that. With 3.1 you have the possibility of wrapping the UnityPlayer View inside your own resource based layout if you wish.

I’m going crazy to try to get the facebook android api to work with unity. Can you please tell me how to do this? The facebook authenticate method needs the current activity and according to the facebook api you need to override onActivityResult to call facebook.authorizeCallback in that current activity, so I guess subclassing the UnityPlayerActivity is the way to go. I’m thinking of doing something like this :

public class UnityPlayerOverwrite extends UnityPlayerActivity {
    
	Facebook facebook = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}
	
	public void loginToFacebook(int APP_ID) {
		facebook = new Facebook("APP_ID");
		
		facebook.authorize(this, new DialogListener() {
			public void onComplete(Bundle values) {
				// Do a UnitySendMessage of some sort to
				// return the facebook access token
				// and then I can do graph api calls
				// with the www class from there.
			}
			
			public void onFacebookError(FacebookError error) {}
			
			public void onError(DialogError e) {}
			
			public void onCancel() {}
		});
	}
    
	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		
		facebook.authorizeCallback(requestCode, resultCode, data);
	}
}

But I just can’t get it to work. Any thoughts on what I’m doing wrong?