mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-03 15:26:27 +00:00
Try to prevent OutOfMemoryException while loading contacts' picture
This commit is contained in:
parent
33a10b0d07
commit
6d32009605
1 changed files with 6 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.MatrixCursor;
|
import android.database.MatrixCursor;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.preference.CheckBoxPreference;
|
import android.preference.CheckBoxPreference;
|
||||||
|
|
@ -274,7 +275,11 @@ public class ApiFivePlus {
|
||||||
contact = new Contact(id, name);
|
contact = new Contact(id, name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
contact = new Contact(id, name, photo, BitmapFactory.decodeStream(input));
|
Bitmap bm = null;
|
||||||
|
try {
|
||||||
|
bm = BitmapFactory.decodeStream(input);
|
||||||
|
} catch (OutOfMemoryError oome) {}
|
||||||
|
contact = new Contact(id, name, photo, bm);
|
||||||
}
|
}
|
||||||
|
|
||||||
return contact;
|
return contact;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue