Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 16th, 2012  |  syntax: None  |  size: 0.50 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Android QuickAction popover always displayed on left of the screen
  2. public class HelpButton extends Button {
  3.   public HelpButton(Context c, AttributeSet attrs) {
  4.     super(c, attrs);
  5.     setOnClickListener(new OnClickListener() {
  6.       public void onClick(View v) {
  7.         QuickAction popover = new QuickAction(getContext());
  8.         ActionItem callout = new ActionItem();
  9.         callout.setTitle(v.getTag().toString());
  10.         popover.addActionItem(callout);
  11.         popover.show(v);
  12.       }
  13.     });
  14.   }
  15. }