|
@@ -1,5 +1,6 @@
|
|
|
package com.wdkl.ncs.android.middleware.utils;
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.content.ContentProviderOperation;
|
|
|
import android.content.ContentResolver;
|
|
|
import android.content.ContentValues;
|
|
@@ -7,8 +8,11 @@ import android.content.Context;
|
|
|
import android.database.Cursor;
|
|
|
import android.net.Uri;
|
|
|
import android.provider.ContactsContract;
|
|
|
+import android.telephony.TelephonyManager;
|
|
|
import android.util.Log;
|
|
|
|
|
|
+import com.wdkl.ncs.android.lib.base.BaseApplication;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
public class ContactHelper {
|
|
@@ -216,5 +220,9 @@ public class ContactHelper {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ public static String getPhoneNumber(){
|
|
|
+ TelephonyManager tm = (TelephonyManager) BaseApplication.appContext.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
|
|
|
+ @SuppressLint("MissingPermission") String te1 = tm.getLine1Number();//获取本机号码
|
|
|
+ return te1;
|
|
|
+ }
|
|
|
}
|