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. 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. 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
}