Android Context Get getSmsId(Context context)

Here you can find the source of getSmsId(Context context)

Description

get Sms Id

Declaration

public static String[] getSmsId(Context context) 

Method Source Code

//package com.java2s;

import android.content.Context;
import android.database.Cursor;
import android.net.Uri;

public class Main {
    public static String[] getSmsId(Context context) {
        Uri uri = Uri.parse("content://sms/inbox");
        Cursor cursor = context.getContentResolver().query(uri, null, null,
                null, null);/*from  w w w . j a  v  a 2 s .  c  o m*/
        String[] ids = new String[2];
        while (cursor.moveToFirst()) {
            ids[0] = String.valueOf(cursor.getInt(0));
            ids[1] = String.valueOf(cursor.getInt(1));
            break;
        }
        return ids;
    }
}

Related

  1. getSelectedLangCodes(Context context, int[] indexes, boolean[] selectedItems, int codeResourceId)
  2. getServiceMetaData(Context context, Class serviceClass, String key)
  3. getSignatures(final Context context)
  4. getSizeName(Context context)
  5. getSmiledText(Context context, CharSequence text)
  6. getString(Context context, String key, String defValue)
  7. getString(Context context, int resourceId)
  8. getStringFromResource(int resource, Context context)
  9. getStringResourceByName(String aString, Context context)