0

我英语不好。对不起..

我关于“​​goole play game service”的问题是这样的。


我使用了“谷歌玩游戏服务”。我应用了多人游戏。当我获得连接的用户个人资料照片时,出现错误。这次成功带来了我的个人资料照片。另一个用户个人资料照片没有带来。为什么?

for (Participant p : mParticipants) {

        Log.d(TAG, "startGetGoogleImage.6");

        //Log.d(TAG, "photo => "    + p.getIconImageUri().toString());
        if (!(p.getParticipantId().equals(mMyId))) {

            //Log.d(TAG, "YOU photo."   + p.getIconImageUri().toString());
            imageManager.loadImage(new OnImageLoadedListener() {
                @Override
                public void onImageLoaded(Uri uri, Drawable drawable) {
                    try {
                        Bitmap bm = ((BitmapDrawable) drawable).getBitmap();
                        ByteArrayOutputStream stream = new ByteArrayOutputStream();
                        bm.compress(Bitmap.CompressFormat.PNG, 50, stream);
                        final byte[] byteArray = stream.toByteArray();

                        // ... some code
                        mCocos2dxGLSurfaceView.queueEvent(new Runnable() {
                            @Override
                            public void run() {
                                // begin((int) arry[1]);
                                // begin();
                                sendImageByte(byteArray);
                            }
                        });
                        Log.d(TAG, "LoadImageFromGoogle Image added #"
                                + byteArray.length);
                    } catch (Exception e) {
                        Log.d(TAG,
                                "LoadImageFromGoogle after loading Exception = "
                                        + e.toString());
                    }
                }

            }, p.getIconImageUri(), android.R.drawable.btn_star);
        }
        // Log.d(TAG, "Participant Name."+p.getDisplayName().toString());

    }

错误信息..

android.graphics.drawable.StateListDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
4

0 回答 0