سؤال

There is a custom listview in my activity. Each item of list has image button at the left hand side. I want to show popup window when button is clicked. And popup window has some image buttons like chat message. I want a popup window like when QuickContactBadge is clicked. How can I do this? and can I use QuickContactBadge (In list my own contacts not phone's contact)? Any help....?

هل كانت مفيدة؟

المحلول

You can create a custom dialog by extend a Dialog and putting your own custom View inside it with any buttons that you like.

Update:

I just checked (visually) the QuickContactBadge. The problem in your case will be how to properly position it so that it will so that it will point to the correct listview item that user clicked. Possible solutions:

  1. Put your existing listview layout inside a FrameLayout and put an empty AbsoluteLayout over it. When listview item is clicked, calculate the coordinates and draw QuickContactBadge in the AbsoluteLayout at the right coordinates so that it would point to the clicked item. Never tried this so I don't know how well this would work:

  2. Use ExpandableListView which expands the item when clicked. In this expaned item you could show the QuickContactBadge or just some buttons that you wish.

Personally, I'd go with 2nd approach.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top