2014-10-30 102 views
2

我刚刚为我的游戏集成了Google Play游戏服务。在日志猫,我看到一个警告说:Google Play游戏服务查看弹出窗口

"10-29 23:13:29.559: W/PopupManager(6985): 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." 

这是我应该担心的事吗? Google的默认视图和布局对我来说没问题。另外,如果我按下主页按钮或进入排行榜活动的设置,它会显示力量关闭 - 没有弹出视图导致该问题的原因?

+0

可能重复http://stackoverflow.com/questions/25923638/you-have-not-specified看看获得root视图-a-view-to-use-as-content-for-popups) – duggu 2014-10-30 04:59:20

+0

并非真的重复,因为他由于其他错误而崩溃,我不认为他解决了这个警告信息。 – Barodapride 2014-10-30 13:48:42

+0

@Barodapride - 你有没有发现这实际上是什么?我在我的LogCat中有这个,但一切工作正常。 – Zippy 2015-01-11 20:16:00

回答

4

这应该得到的东西的工作:

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    Log.d(TAG, "onCreate"); 

    setContentView(R.layout.activity_main); 

    // Create the Google API Client with access to Plus, Games and Drive 
    // Also set the view for popups 
    mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext()) 
      .addConnectionCallbacks(this) 
      .addOnConnectionFailedListener(this) 
      .addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN) 
      .addApi(Games.API).addScope(Games.SCOPE_GAMES) 
      .addApi(Drive.API).addScope(Drive.SCOPE_APPFOLDER) 
      .setViewForPopups(findViewById(android.R.id.content)) 
      .build(); 

} 

android.R.id.content为您提供了一个视图的根元素,而不必知道它的实际名称/类型/ ID。从当前活动

的[“你还没有指定一个视图作为弹出窗口的内容用”(
相关问题