views:

11

answers:

0

I'm fairly new to Android and I'm trying to integrate the Facebook API for Android but I can't get the dialog to display on screen despite not seeing any errors or warnings via the debugger.

I've tried two approaches and both failed. The first is the standard Facebook SDK approach where I call


String[] PERMISSIONS = new String[] {"publish_stream", "read_stream", "offline_access"};
fbobject.authorize( PMGLSurfaceView.myContent, "feature.PMSocialFacebook.fb_appid", PERMISSIONS, new LoginDialogListener() );

when a game UI element is pressed. The second method is to call

MyActivity.showDialog( 1 );

instead and call a second function to do the authorise in onCreateDialog(int id).

The FbDialog which inherits from the Android Dialog class gets its onCreate() function called but the dialog never appears on screen. I've also tried creating a simpler dialog like a progress dialog using the example code:

ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "", 
                        "Loading. Please wait...", true);

which also doesn't work. I did manage to get this code to show a dialog once but only when called from MyGLSurfaceView.onTouchEvent() which makes me think the problem is either related to threads or the GLSurfaceView itself.

Any ideas where I could be going wrong? I can show code if you need it but there's so much I didn't want to spam this thread with stuff that's not relevant.