aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/utils/PhoneHelper.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-10 15:24:34 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-10 15:24:34 +0100
commitcfc74e7c8e912c7a194ad674ec5f98ab6950640f (patch)
tree95aae079591ae9462697499a965ec89b13a83113 /src/de/gultsch/chat/utils/PhoneHelper.java
parent2d0c0e6a4081955b68669c82071a5099e2e1a96e (diff)
fixed a bug where account options where toggled instead of set off. fixed null pointer for missing selfi. made sefli optional
Diffstat (limited to 'src/de/gultsch/chat/utils/PhoneHelper.java')
-rw-r--r--src/de/gultsch/chat/utils/PhoneHelper.java17
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));
+ }
+ }
}