相关疑难解决方法(0)

从RemoteViews调用setImageDrawable

我在一个Activity中完成了这项工作,它完美无缺.

ImageView myImage = (ImageView) findViewById(R.id.myImageView);

ShapeDrawable mDrawable;

mDrawable = new ShapeDrawable(new OvalShape());
mDrawable.getPaint().setColor(0xff74AC23);
mDrawable.setBounds(x, y, x + width, y + height);
mDrawable.setIntrinsicWidth(width);
mDrawable.setIntrinsicHeight(height);

myImage.setImageDrawable(mDrawable);
Run Code Online (Sandbox Code Playgroud)

现在我想在一个小部件(内部onUpdate)中做同样的事情,我必须RemoteViews用来访问图像.

我怎么叫setImageDrawableImageView,从RemoteViews?所有远程视图方法似乎都需要Bitmap.

android android-imageview remoteview shapedrawable

2
推荐指数
1
解决办法
6619
查看次数