0

I'm trying to implement achievements with Google Play Services in a game. I have followed up the steps in this documentation and everything is ok except I got a runtime warning and then a crush. The warning is:

06-09 10:43:05.900: W/PopupManager(17888): You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of the API. Use setViewForPopups() to set your content view.

My application is using openGL and the activity has a member mView that extends GLSurfaceView.

I have tried this and this (I have all those meta tags and the app_id setup correctly).

Also, TypeANumber starts correctly with my app_id.

Can anyone help me on this?

EDIT [added some code]:

Here is the Activity declaration:

public class GGActivity extends BaseGameActivity implements SensorEventListener, IDownloaderClient {

Here is onCreate where the problem occurs (after the change suggested by free3dom):

public GGView mView;

    @Override protected void onCreate(Bundle icicle) {

        setRequestedClients(BaseGameActivity.CLIENT_GAMES | BaseGameActivity.CLIENT_APPSTATE);
        //if (DEBUG_BUILD)
        {
            enableDebugLog(true);
        }
        setContentView(mView); // make sure mView is created before
        getGameHelper().createApiClientBuilder();
        getGameHelper().getApiBuilder().setViewForPopups( mView );
        super.onCreate(icicle);

YES, setContentView helped. Thanks!

Community
  • 1
  • 1
Sulea Cosmin
  • 598
  • 1
  • 11
  • 24
  • 1
    Without any code it is difficult to guess at the problem, but it seems that maybe you have not set the view for the activity. You can do this by calling [setContentView(mView);](http://developer.android.com/reference/android/app/Activity.html#setContentView%28android.view.View%29) after creating your `GLSurfaceView`. – free3dom Jun 09 '14 at 15:27
  • Hi free3dom, setContentView helped, please, if you want, make it as an answer so I can accept it, Thanks. – Sulea Cosmin Jun 09 '14 at 17:19
  • Glad it worked for you. I have added it as an answer now that it is the confirmed solution. – free3dom Jun 09 '14 at 19:45

1 Answers1

1

In order for your activity to recognize and use the GLSurfaceView you have to set it. This can be done by calling

setContentView(mView);

after creating the GLSurfaceView (documentation can be found here).

free3dom
  • 18,729
  • 7
  • 52
  • 51