【发布时间】:2014-06-09 13:00:23
【问题描述】:
我正在尝试在游戏中使用 Google Play 服务实现成就。我已按照this 文档中的步骤进行操作,一切正常,除了我收到运行时警告,然后是迷恋。警告是:
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.
我的应用程序正在使用 openGL,并且活动有一个扩展 GLSurfaceView 的成员 mView。
我已经尝试过this 和this(我已经正确设置了所有这些元标记和 app_id)。
此外,TypeANumber 以我的 app_id 正确开头。
谁能帮我解决这个问题?
编辑[添加一些代码]:
这是活动声明:
public class GGActivity extends BaseGameActivity implements SensorEventListener, IDownloaderClient {
这里是出现问题的onCreate(在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);
是的,setContentView 有帮助。谢谢!
【问题讨论】:
-
没有任何代码很难猜出问题,但似乎您没有为活动设置视图。您可以通过在创建
GLSurfaceView后调用 setContentView(mView); 来完成此操作。 -
您好 free3dom,setContentView 帮助了,如果您愿意,请将其作为答案,以便我接受,谢谢。
-
很高兴它对你有用。现在我已将其添加为答案,因为它是已确认的解决方案。
标签: android opengl-es google-play-services