2013-10-23 44 views
0

我有一個聯繫人列表的應用程序,在這裏我需要ASIGN到觸點接觸時,它的名字以示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 
    } 

回答

0

只需調用這個函數,我已經能夠解決這個問題:

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