diff options
Diffstat (limited to '')
-rw-r--r-- | src/de/gultsch/chat/utils/PhoneHelper.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/de/gultsch/chat/utils/PhoneHelper.java b/src/de/gultsch/chat/utils/PhoneHelper.java index f1d491d6..3a53c08f 100644 --- a/src/de/gultsch/chat/utils/PhoneHelper.java +++ b/src/de/gultsch/chat/utils/PhoneHelper.java @@ -3,13 +3,16 @@ package de.gultsch.chat.utils; import java.util.ArrayList; import java.util.Hashtable; +import android.app.Activity; import android.content.Context; import android.content.CursorLoader; import android.content.Loader; import android.content.Loader.OnLoadCompleteListener; import android.database.Cursor; +import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; +import android.provider.ContactsContract.Profile; public class PhoneHelper { @@ -62,4 +65,18 @@ public class PhoneHelper { }); mCursorLoader.startLoading(); } + + public static Uri getSefliUri(Activity activity) { + String[] mProjection = new String[] { Profile._ID, + Profile.PHOTO_THUMBNAIL_URI }; + Cursor mProfileCursor = activity.getContentResolver().query( + Profile.CONTENT_URI, mProjection, null, null, null); + + if (mProfileCursor.getCount()==0) { + return null; + } else { + mProfileCursor.moveToFirst(); + return Uri.parse(mProfileCursor.getString(1)); + } + } } |