2014-10-30 199 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。從當前活動

的[「你還沒有指定一個視圖作爲彈出窗口的內容用」(
相關問題