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


此时,我对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
}发布于 2013-10-23 15:22:33
只要调用这个函数,我就能解决这个问题:
QuickContact.showQuickContact(getActivity(), getListView(), uri, position, null);https://stackoverflow.com/questions/19543790
复制相似问题