I've caught a code example to pinch and zoom an image. The works ok. The problem is when I implement this code in my app. I have an OutOfMemoryError here:
view.setImageResource (R.drawable.planometro);
To solve this problem I found this code:
public Drawable getAssetImage (String filename) throws IOException {
AssetManager assets = getResources () getAssets ().;
InputStream buffer = new BufferedInputStream ((assets.open ("drawable /" + filename +)) "png.");
Bitmap bitmap = BitmapFactory.decodeStream (buffer);
return new BitmapDrawable (getResources (), bitmap);
}
The problem is that this code is to return an int, not a drawable. How I can fix my error?
Thanks