Hy everbody!
I've a minor problem but a problem!
I transmit between 2 activities 6 photos max. but the loading between 2 is really long (6-10sec).
my code :
String[] toShare = getIntent().getStringArrayExtra("toShare");
for (int i = 0; i < toShare.length; i++) {
if(toShare[i] != null){
LesPlus.get(i).setImageBitmap(genereThumb(toShare[i]));
}else{
LesPlus.get(i).setImageDrawable(getResources().getDrawable(R.drawable.btnadd));
}
}
genereThumb :
File file = new File(path);
FileInputStream fs=null;
Bitmap bm = null;
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int largeurEcran = dm.widthPixels;
int LargeurCol = (int) ((largeurEcran / 3) - 15);
BitmapFactory.Options bfOptions=new BitmapFactory.Options();
bfOptions.inDither=false;
bfOptions.inPurgeable=true;
bfOptions.inInputShareable=true;
bfOptions.inTempStorage=new byte[32 * 1024];
try {
fs = new FileInputStream(file);
} catch (FileNotFoundException e) {
System.out.println(e);
}
try {
if(fs!=null) bm=BitmapFactory.decodeFileDescriptor(fs.getFD(), null, bfOptions);
} catch (IOException e) {
e.printStackTrace();
} finally{
if(fs!=null) {
try {
fs.close();
} catch (IOException e) {
System.out.println(e);
}
}
}
return Bitmap.createScaledBitmap(bm, LargeurCol, LargeurCol, true);
}
I devellop on a Galaxy S2 if its can help :D. Thanks for your anwers