[英]Show QuickContact dialog
I have a Contact List app, where I need to asign to the contacts name the function to show QuickContact dialog window when touching it: 我有一个“联系人列表”应用程序,在这里我需要将联系人姓名分配给该函数,以便在触摸它时显示“快速联系人”对话框窗口:
At this moment, I do this procesing the QuickContactBadge that appears as a contact's thumbnail. 目前,我要执行QuickContactBadge(显示为联系人缩略图)的操作。 This is, when I touch the thumbnail, it appears this dialog window.
即,当我触摸缩略图时,它将显示此对话框窗口。
This is the code snippet: 这是代码片段:
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);
After this, I've got this interface, that is called in other activity: 之后,我得到了这个接口,在其他活动中称为:
public interface OnContactsInteractionListener {
/**
* Called when a contact is selected from the ListView.
* @param contactUri The contact Uri.
*/
public void onContactSelected(Uri contactUri);
This is the main activity where this interface is called, and where I must implement the function to call to the QuickContact dialog window wich shows the contact information . 这是调用此接口的主要活动, 我必须在其中实现调用QuickContact对话框的功能,该窗口显示联系人信息 。 This is what I don't know how to do.
这是我不知道该怎么做。
public class ContactsListActivity extends FragmentActivity implements ContactsListFragment.OnContactsInteractionListener {
...
public void onContactSelected(Uri contactUri) {
//METHOD TO CALL QUICKCONTACT WINDOW
}
只需调用此函数,我就能解决此问题:
QuickContact.showQuickContact(getActivity(), getListView(), uri, position, null);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.