Sign in to follow this  
styuR

Android Image Loading

Recommended Posts

I'm having issues with the way that I'm loading my images in Android, this is the way I'm doing it just now.


[CODE]try{
AssetManager assetManager = context.getAssets();
inputStream = assetManager.open("blackcat.png");
cat = BitmapFactory.decodeStream(inputStream);
inputStream.close();

inputStream = assetManager.open("Jellyfish1.png");
jellyfish = BitmapFactory.decodeStream(inputStream);
inputStream.close();

inputStream = assetManager.open("/Dog.png");
bigdog = BitmapFactory.decodeStream(inputStream);
inputStream.close();

inputStream = assetManager.open("exit.png");
exitTile = BitmapFactory.decodeStream(inputStream);
inputStream.close();

inputStream = assetManager.open("kitchen.png");
background = BitmapFactory.decodeStream(inputStream);
inputStream.close();

inputStream = assetManager.open("endscreen.png");
gameover = BitmapFactory.decodeStream(inputStream);
inputStream.close();
}catch(IOException ex){}[/CODE]

Any help would be massively appreciated as I'm pretty stuck for what to do now. Edited by styuR

Share this post


Link to post
Share on other sites
Is there any reason you are loading them from assets instead of resources? As I recall loading them from resources is slightly easier.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this