显示QuickContact对话框

时间:2013-10-23 13:59:11

标签: android contacts quickcontactbadge quickcontact

我有一个联系人列表应用程序,我需要在触摸时将联系人命名为函数以显示QuickContact对话框窗口:

1 http://img600.imageshack.us/img600/7877/7uq7.png 2 http://img543.imageshack.us/img543/6910/gk9f.png

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

这是代码段:

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
    }

1 个答案:

答案 0 :(得分:0)

只要调用此函数,我就能解决这个问题:

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