當前位置: 首頁>>代碼示例>>Java>>正文


Java Contacts.CONTACT_STATUS屬性代碼示例

本文整理匯總了Java中android.provider.ContactsContract.Contacts.CONTACT_STATUS屬性的典型用法代碼示例。如果您正苦於以下問題:Java Contacts.CONTACT_STATUS屬性的具體用法?Java Contacts.CONTACT_STATUS怎麽用?Java Contacts.CONTACT_STATUS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.provider.ContactsContract.Contacts的用法示例。


在下文中一共展示了Contacts.CONTACT_STATUS屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onActivityCreated

@Override public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // Give some text to display if there is no data.  In a real
    // application this would come from a resource.
    setEmptyText("No phone numbers");

    // We have a menu item to show in action bar.
    setHasOptionsMenu(true);

    // Create an empty adapter we will use to display the loaded data.
    mAdapter = new SimpleCursorAdapter(getActivity(),
            android.R.layout.simple_list_item_2, null,
            new String[] { Contacts.DISPLAY_NAME, Contacts.CONTACT_STATUS },
            new int[] { android.R.id.text1, android.R.id.text2 }, 0);
    setListAdapter(mAdapter);

    // Start out with a progress indicator.
    setListShown(false);

    // Prepare the loader.  Either re-connect with an existing one,
    // or start a new one.
    getLoaderManager().initLoader(0, null, this);
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:24,代碼來源:LoaderCursor.java

示例2: getContactsByGroup

@Override
public Cursor getContactsByGroup(Context ctxt, String groupName) {

    if (TextUtils.isEmpty(groupName)) {
        return null;
    }

    String[] projection;
    if (Compatibility.isCompatible(11)) {
        projection = new String[] {
                Contacts._ID,
                Contacts.DISPLAY_NAME,
                Contacts.PHOTO_ID,
                Contacts.CONTACT_STATUS_ICON,
                Contacts.CONTACT_STATUS,
                Contacts.CONTACT_PRESENCE,
                Contacts.PHOTO_URI
        };
    } else {
        projection = new String[] {
                Contacts._ID,
                Contacts.DISPLAY_NAME,
                Contacts.PHOTO_ID,
                Contacts.CONTACT_STATUS,
                Contacts.CONTACT_PRESENCE
        };
    }

    Uri searchUri = Uri.withAppendedPath(Contacts.CONTENT_GROUP_URI, Uri.encode(groupName));
    
    
    Cursor c = null;
    try {
        c = ctxt.getContentResolver().query(searchUri, projection, null, null,
                Contacts.DISPLAY_NAME + " ASC");
    } catch(Exception e) {
        Log.e(THIS_FILE, "Error while retrieving group", e);
    }
    return c;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:40,代碼來源:ContactsUtils5.java

示例3: onActivityCreated

@Override public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // In this sample we are going to use a retained fragment.
    setRetainInstance(true);

    // Give some text to display if there is no data.  In a real
    // application this would come from a resource.
    setEmptyText("No phone numbers");

    // We have a menu item to show in action bar.
    setHasOptionsMenu(true);

    // Create an empty adapter we will use to display the loaded data.
    mAdapter = new SimpleCursorAdapter(getActivity(),
            android.R.layout.simple_list_item_2, null,
            new String[] { Contacts.DISPLAY_NAME, Contacts.CONTACT_STATUS },
            new int[] { android.R.id.text1, android.R.id.text2 }, 0);
    setListAdapter(mAdapter);

    // Start out with a progress indicator.
    setListShown(false);

    // Prepare the loader.  Either re-connect with an existing one,
    // or start a new one.
    getLoaderManager().initLoader(0, null, this);
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:27,代碼來源:LoaderRetained.java


注:本文中的android.provider.ContactsContract.Contacts.CONTACT_STATUS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。