Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert int to Integer

Tags:

android

private static HashMap<Integer, Bitmap> mBitmapCache;          mBitmapCache.put(R.drawable.bg1,object);                        

R.drawable.bg1 is an int ... but i want to convert into Integer because Hashmap takes an Integer... and when draw the multiple objects in seconds , it creates a Integer Object runtime which affects the performence of the code...

like image 351
user643144 Avatar asked Mar 25 '11 06:03

user643144


1 Answers

int iInt = 10; Integer iInteger = Integer.valueOf(iInt); 

P.S. Answer edited due to comments pointing out an issue with initial suggested solution.

like image 105
Olegas Avatar answered Oct 06 '22 11:10

Olegas