我試圖顯示通過Google+登錄到我的應用的用戶的個人資料圖片,但我不知道如何做到這一點。要獲取圖片(和其他信息),谷歌提供的代碼在Android應用中顯示谷歌加用戶個人資料圖片
@Override
public void onConnected() {
...
if (mPlusClient.getCurrentPerson() != null) {
Person currentPerson = mPlusClient.getCurrentPerson();
String personName = currentPerson.getDisplayName();
String personPhoto = currentPerson.getImage();
String personGooglePlusProfile = currentPerson.getUrl();
}
}
我知道,通常我需要得到我想從res/drawable...
顯示任何圖像,但我不知道做什麼用的personPhoto
值做(這在某種程度上得到的來自String
類型更改爲Image
時您將代碼粘貼到Eclipse中。
有是Google Play服務中的輔助程序類,用於加載從其返回的圖像:http://developer.android.com/reference/com/google/android/gms/common/images/ImageManager.html –