मुझे एपीआई से बीएलओबी प्रकार के रूप में छवि मिल रही है। और, मैं इस प्रकार की बचत कर रहा हूँ,छवि देखें आधा लोड या एंड्रॉइड में नहीं
public static void setOptimalImage(Context ctx, File file, ImageView iv,
Point size) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(file.getPath(), options);
if (options.outHeight > 0 && options.outWidth > 0) {
if (size == null) {
size = new Point();
WindowManager wm = (WindowManager) ctx
.getSystemService(Context.WINDOW_SERVICE);
wm.getDefaultDisplay().getSize(size);
}
options.inSampleSize = Utils.calculateInSampleSize(options, size.x,
size.y);
options.inJustDecodeBounds = false;
try {
iv.setImageBitmap(BitmapFactory.decodeFile(file.getPath(),
options));
} catch (OutOfMemoryError oome) {
Log.e(Utils.class.getName(),
oome.getMessage() == null ? "OutOfMemory error: "
+ file.getName() : oome.getMessage());
}
}
}
अब, इस मुद्दे को मैं का सामना करना पड़ रहा है,
जब मैं यह बचत कर रहा हूँ, कभी कभी छवि केवल half.Now की बचत है, मेरे सवाल है,
- क्या फ़ाइल पथ से छवि को जांचने का कोई तरीका है आधे लोड (जिसका अर्थ है दूषित)?
संपादित करें:
- मैं सर्वर से एक छवि डाउनलोड कर रहा हूँ। इस बीच, मैंने अपना शुद्ध कनेक्शन खो दिया है। उस स्थिति में, मेरी छवि आधे डाउनलोड कर रही है। क्या मैं उन दूषित छवियों को प्रोग्रामेटिक रूप से प्राप्त कर सकता हूं? या किसी भी विचार को इस मामले में कैसे संभालना है?
किसी भी मदद की वास्तव में सराहना की जाएगी।
धन्यवाद। संदर्भ के लिए
अटैच किया जा रहा छवि:
@ मॅनू आपको छवि को सहेजने के बाद गैलरी को रीफ्रेश करने की आवश्यकता है http://stackoverflow.com/questions/15837485/how-can-i-update-the-android-gallery-after-a-photo और आपको रीफ्रेश करने के बाद छवि सेट करने की जरूरत है –