我试图从FB获取用户的个人资料图片并在我的应用程序上以圆形图像显示它.我能够检索并显示Facebook SDK提供的ProfilePictureView小部件中的显示图片.但是当我尝试获取该图像的位图并尝试将其置于圆形图像视图中时,我得到了默认的FB显示图片,如果您没有显示图片,则每个人都会被分配.我无法解决这个问题.我这样做是为了从ProfilePictureView中获取位图并将其设置为我的圆形视图.
if (session == Session.getActiveSession()) {
if (user != null) {
// Set the id for the ProfilePictureView
// view that in turn displays the profile picture.
profilePictureView.setDrawingCacheEnabled(true);
profilePictureView.setProfileId(user.getId());
Bitmap bitmap = profilePictureView.getDrawingCache();
Bitmap circleBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
BitmapShader shader = new BitmapShader (bitmap, TileMode.CLAMP, TileMode.CLAMP);
Paint paint = new Paint();
paint.setShader(shader);
Canvas c = new Canvas(circleBitmap);
c.drawCircle(bitmap.getWidth()/2, bitmap.getHeight()/2, bitmap.getWidth()/2, paint);
profilePic.setImageBitmap(circleBitmap);
//profilePictureView.draw(c);
//c.drawCircle(bitmap.getWidth()/2, bitmap.getHeight()/2, bitmap.getWidth()/2, paint);
}
Run Code Online (Sandbox Code Playgroud)
这里profilePic是我想要放置圆形的ImageView,而profilePictureView是具有显示pic的ProfilePictureView id.
我目前正在Android中开发一个使用Google地图的应用程序.我遵循了所有的指示
谷歌地图按预期正常显示,直到现在突然出现黑屏.
我在logcat上得到以下几行.
W/ResourcesManager:资产路径'/system/framework/com.android.media.remotedisplay.jar'不存在或不包含任何资源.
W/ResourcesManager:资产路径'/system/framework/com.android.location.provider.jar'不存在或不包含任何资源.
I/Google Maps Android API:Google Play服务客户端版本:6587000
I/Google Maps Android API:Google Play服务包版本:6774436
这是我在build.gradle文件中的依赖项
编译'com.google.android.gms:play-services:6.5.87'
我该如何解决这个问题?这是由于谷歌播放服务的一些更新?如果是这样,我已经检查了SDK并且安装了最新的Google Play服务.请帮助任何人
这是日志猫
02-19 13:53:01.212 14731-14749 D/OpenGLRenderer? Render dirty regions requested: true
02-19 13:53:01.218 14731-14731 D/Atlas? Validating map...
02-19 13:53:01.292 14731-14749 I/Adreno-EGL? <qeglDrvAPI_eglInitialize:410>: QUALCOMM Build: 10/03/14, c40da3f, Ifda814c646
02-19 13:53:01.293 14731-14749 I/OpenGLRenderer? Initialized EGL, version 1.4
02-19 13:53:01.311 14731-14749 D/OpenGLRenderer? Enabling debug mode 0
02-19 13:53:04.472 14731-14731 I/x? Making Creator dynamically
02-19 13:53:04.477 14731-14731 W/ResourcesManager? Asset path …Run Code Online (Sandbox Code Playgroud)