【问题标题】:Show QuickContact dialog显示 QuickContact 对话框
【发布时间】:2013-10-23 13:59:11
【问题描述】:

我有一个联系人列表应用程序,我需要在其中为联系人名称分配功能,以便在触摸它时显示 QuickContact 对话窗口:

此时,我会处理显示为联系人缩略图的 QuickContactBadge。也就是说,当我触摸缩略图时,它会出现这个对话窗口。

这是代码sn-p:

public class ContactsListFragment extends ListFragment implements AdapterView.OnItemClickListener, LoaderManager.LoaderCallbacks<Cursor> {
...

    private class ContactsAdapter extends CursorAdapter implements SectionIndexer {
    ...

        /** Generates the contact lookup Uri*/
        final Uri contactUri = Contacts.getLookupUri(
                cursor.getLong(ContactsQuery.ID),
                cursor.getString(ContactsQuery.LOOKUP_KEY));

        /** Binds the contact's lookup Uri to the QuickContactBadge*/
        holder.icon.assignContactUri(contactUri);

        /** Loads the thumbnail image pointed to by photoUri into the QuickContactBadge in a
         * background worker thread
         */
        mImageLoader.loadImage(photoUri, holder.icon);

在这之后,我得到了这个接口,在其他活动中被调用:

public interface OnContactsInteractionListener {
    /**
     * Called when a contact is selected from the ListView.
     * @param contactUri The contact Uri.
     */
    public void onContactSelected(Uri contactUri);

这是调用此接口的主要活动,我必须在其中实现调用 QuickContact 对话框窗口的函数,该窗口显示联系人信息这是我不知道该怎么做。

public class ContactsListActivity extends FragmentActivity implements ContactsListFragment.OnContactsInteractionListener {
...

    public void onContactSelected(Uri contactUri) {
        //METHOD TO CALL QUICKCONTACT WINDOW
    }

【问题讨论】:

    标签: android contacts quickcontactbadge quickcontact


    【解决方案1】:

    只要调用这个函数,我就可以解决这个问题了:

    QuickContact.showQuickContact(getActivity(), getListView(), uri, position, null);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-12
      • 2013-06-28
      相关资源
      最近更新 更多