RT
例如随便自定义一个
class A
{
public Bitmap bp;
public A()
{
bp=BitmapFactory.decodeResource(***,id);
//问题就在这,这个***参数该怎么写?如果是在view类中可以getResources()等,但在自定义类中怎么办?求大手指点一二。
}
}
安卓 图片资源 自定义类
------解决方案--------------------
可以用BitmapFactory.decodeStream(inputStream);试试
AssetManager assetManager = context.getAssets();
InputStream inputStream = assetManager.open("bobrgb888.png");
bob565 = BitmapFactory.decodeStream(inputStream);
inputStream.close();
------解决方案--------------------
Application也是context,用application试试
------解决方案--------------------
lz看看这个http://zhidao.baidu.com/question/393391433.html
我百度的
