Hi it is null
because may be the image size is big and getting exception please check your log and see is there any error of outofmemory bitmap if yes then use options for that:
BitmapFactory.Options options;
try {
String imageInSD = "/sdcard/UserImages/" + userImageName;
Bitmap bitmap = BitmapFactory.decodeFile(imageInSD);
return bitmap;
} catch (OutOfMemoryError e) {
try {
options = new BitmapFactory.Options();
options.inSampleSize = 2;
Bitmap bitmap = BitmapFactory.decodeFile(imageInSD, null, options);
return bitmap;
} catch(Exception excepetion) {
Log.e(excepetion);
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…