public void OnMomentsLoaded(ConnectionResult status, MomentBuffer momentBuffer, String nextPageToken, String updated) { if (status.GetErrorCode() == ConnectionResult.SUCCESS) { mListItems.Clear(); try { int count = momentBuffer.GetCount(); for (int i = 0; i < count; i++) { mListItems.Add(momentBuffer.Get(i).Freeze()); } } finally { momentBuffer.Close(); } mMomentListAdapter.NotifyDataSetChanged(); } else { Log.E(TAG, "Error when loading moments: " + status.GetErrorCode()); } }
// Perform resolution given a non-null result. private void resolveLastResult() { if (GooglePlayServicesUtil.IsUserRecoverableError(mLastConnectionResult.GetErrorCode())) { // Show a dialog to install or enable Google Play services. showErrorDialog(ErrorDialogFragment.Create(mLastConnectionResult.GetErrorCode(), mRequestCode)); return; } if (mLastConnectionResult.HasResolution()) { startResolution(); } }
public void OnPeopleLoaded(ConnectionResult status, PersonBuffer personBuffer, String nextPageToken) { if (status.GetErrorCode() == ConnectionResult.SUCCESS) { mListItems.Clear(); try { int count = personBuffer.GetCount(); for (int i = 0; i < count; i++) { mListItems.Add(personBuffer.Get(i).GetDisplayName()); } } finally { personBuffer.Close(); } mListAdapter.NotifyDataSetChanged(); } else { Log.E(TAG, "Error when listing people: " + status); } }