• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • About
  • Projects
    • GStaticMap WP Plugin
  • Contact
  • Privacy Policy

Lorenz Blog

All About Web & Mobile Application Development

  • Featured Articles
  • Gadgets
    • Android
    • Blackberry
  • Programming
    • Android
    • PHP
    • Java Script
    • MySQL
    • Postgresql
    • Flex
    • Web
  • Software
    • Mac OS
    • Windows
    • Linux
  • Web
You are Here » Home >> Information Technology >> Programming >> Android >> How to Create QuickAction Dialog in Android

How to Create QuickAction Dialog in Android

July 12, 2010 by Lorensius Londa 303 Comments

[Update 15/07/2011]

I have updated the quickaction implementation code so it can be used more efficient and the dialog will be automatically dismissed after pressing the action item. All the source codes now available via github so you can track the changes.

Official Twitter application for Android  has introduced new Android UI features and behavior patterns such as Dashboard, Search Bar, QuickAction and Action Bar. One of the interesting pattern is QuickActions that displays contextual actions in a list view. This pattern actually already exists in QuickContact dialog/bar in default Contact application (since Android 2.0).

QuickContact QuickContact

The QuickActions dialog is not included in standard Android SDK, so we have to create it manually. At first, i had no idea on how to create it so i decided to download and read the Contact app source code from  Android git. I found that the QuickContact dialog  uses private API call (com.android.internal.policy.PolicyManager) that does not exists in standard SDK. After posting question about it on google groups and stack overflow, i got the solution for it from Qberticus (thanx Qberticus!).

Qberticus’s QuickActions uses simple/plain layout so i have to create a custom layout so it will look like QuickContact in Contact app or QuickActions in Twitter app. Based on QuickContact source code, i made a slight modification on Qberticus’s BetterPopupWindow class and extended it to implement custom layout. I also made it customizeable, so the icon and text in action list can be customized.

Here are the screenshoots of QuickActions demo:

QuickContact / Twitter-like QuickActions

Code snippet
Create action items

<br />//Add action item<br />ActionItem addAction = new ActionItem();<br /><br />addAction.setTitle("Add");<br />addAction.setIcon(getResources().getDrawable(R.drawable.ic_add));<br /><br />//Accept action item<br />ActionItem accAction = new ActionItem();<br /><br />accAction.setTitle("Accept");<br />accAction.setIcon(getResources().getDrawable(R.drawable.ic_accept));<br /><br />//Upload action item<br />ActionItem upAction = new ActionItem();<br /><br />upAction.setTitle("Upload");<br />upAction.setIcon(getResources().getDrawable(R.drawable.ic_up));<br />

Line 02: Create new action item
Line 04: Set action title
Line 05: Set action icon

Create quickaction instance and setup listener

<br />final QuickAction mQuickAction 	= new QuickAction(this);<br /><br />mQuickAction.addActionItem(addAction);<br />mQuickAction.addActionItem(accAction);<br />mQuickAction.addActionItem(upAction);<br /><br />//setup the action item click listener<br />mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {<br /><%%KEEPWHITESPACE%%>	@Override<br /><%%KEEPWHITESPACE%%>        public void onItemClick(int pos) {<br /><%%KEEPWHITESPACE%%>		if (pos == 0) { //Add item selected<br /><%%KEEPWHITESPACE%%>		   Toast.makeText(Example1Activity.this, "Add item selected", Toast.LENGTH_SHORT).show();<br /><%%KEEPWHITESPACE%%>		} else if (pos == 1) { //Accept item selected<br /><%%KEEPWHITESPACE%%>		   Toast.makeText(Example1Activity.this, "Accept item selected", Toast.LENGTH_SHORT).show();<br /><%%KEEPWHITESPACE%%>		} else if (pos == 2) { //Upload item selected<br /><%%KEEPWHITESPACE%%>		   Toast.makeText(Example1Activity.this, "Upload items selected", Toast.LENGTH_SHORT).show();<br /><%%KEEPWHITESPACE%%>		}<br /><%%KEEPWHITESPACE%%>	}<br />});<br />

Line 1: Create quickaction instance
Line 3-5: Add the action items into quikaction
Line 8: Setup listener for action item clicked, the pos argument on onItemClick method shows which action item is clicked.

Show quickAction dialog

<br />btn1.setOnClickListener(new View.OnClickListener() {<br />@Override<br />public void onClick(View v) {<br /><%%KEEPWHITESPACE%%>	mQuickAction.show(v);<br />}<br />});<br />

[ad]

Line 04: Show quickaction dialog, the v argument used as the anchor where the quickaction displayed.

Download source code (Github)

Gallery3D-like QuickActions

Download source code (Github)

Implementation on My Application

BlitzDroid

Minapolitan (Prototype)

Buy me a coffee

If you found this stuff useful to your work, please consider a donation.
By doing this you will be helping me to keep improving this stuff and to continue to help anyone who needs, and maybe keep on helping you in the future.




Thanks for your support, will do my best to keep the info fresh and useful.

Facebooktwitterredditpinterestlinkedinmailby feather

Related posts:

  1. How to Select and Crop Image on Android
  2. How to Create Android Image Picker
  3. Android Tips: How to Place Image or Logo at The Center of Actionbar
  4. How to Show “What’s New” Dialog in Android App

Filed Under: Android, Featured Articles, Information Technology, Programming Tagged With: alert dialog, Android, dialog, evolving ui, popup, popup window, quick action, quick contact, quickactions, quickcontact, twitter, twitter app, ui design, ui pattern

About Lorensius Londa

Passionate web and mobile application developer. Co-founder of TRUSTUDIO, loves programming, Android, aviation, travelling, photography, coffee and gym mania.

Reader Interactions

Comments

  1. kyith says

    July 14, 2010 at 6:00 am

    this is a god send!

    Reply
  2. Dragan says

    July 14, 2010 at 6:14 pm

    This is huge man. I’ve been searching for Tweeter app source code all time since it was published just to find out how this QuickActions bar works.
    Thank you very much.

    Reply
  3. Imrabti says

    July 18, 2010 at 5:10 pm

    Thank you, I was searching for this a long time ago.

    Reply
  4. akex says

    July 26, 2010 at 3:58 am

    Thank you.

    I modified a bit your code (i did it first with Qberticus.

    Replacing in CustomPopupWindow

    this :

    if (rootHeight > anchorHeight) {

    by :

    if (rootHeight > anchor.getTop() {

    Cause in Listview, i managed to have Quickactionbar over my title bar, not so nice. With getTop, no problem anymore.

    Reply
    • lorenz says

      July 26, 2010 at 7:30 am

      Okay thanx Akex for the correction 🙂

      Reply
  5. akex says

    July 26, 2010 at 6:43 pm

    Shared your page with some other french devs. Lot of thanks for you 🙂 and Qberticus

    Reply
    • lorenz says

      July 27, 2010 at 1:20 pm

      Okay & you’re welcome 🙂

      Reply
  6. Matt Oakes says

    July 27, 2010 at 3:54 am

    Thanks for the code. I’m guessing the code is released under the same licence as the original code (new BSD licence)?

    Thanks again. I’ll make sure to mention it at the MANGTUG meeting next week 🙂

    Reply
    • lorenz says

      July 27, 2010 at 1:19 pm

      You’re welcome & yes 😀

      Reply
      • Matt Oakes says

        July 27, 2010 at 5:32 pm

        Perfect. Thank you 🙂

        Reply
  7. 5xnewx says

    August 5, 2010 at 2:04 pm

    Hi Lorenz,
    If i wanna like t olearn adnroid prgramming development and contribute, how it can be started. I have done and replciated exact tools steps which you have mentioned in your blog.

    Now what are the resources where i can learn to program and develop android application.

    Appreciate your time and support on your blog.

    Thanks,

    Reply
    • lorenz says

      August 5, 2010 at 8:06 pm

      Hi 5xnewx,

      Glad to hear you are interested in Android Programming. You can find android resources on android developers site http://developer.android.com/guide/index.html. Sample tutorials can be found here http://developer.android.com/resources/samples/get.html

      Reply
  8. Ash says

    August 6, 2010 at 6:56 pm

    Thanks a lot … !!!
    I was stuck in my project without this ….
    u r an angel 🙂 🙂 🙂

    Reply
  9. scottyab says

    August 11, 2010 at 7:03 pm

    Thanks, can’t wait to try it out later. Did you look into the Action bar that’s also mentioned in the google I/O talk and in the Twitter app.

    Reply
  10. Ash says

    August 13, 2010 at 1:20 pm

    I am making my own Contact mgmt system & implemented the above code. i need 2 implement the further functionality now.. ie; to make a call after clicking on the “Call” Action Item.. I have the code to initiate a call from Android. But as you see in the Native Address Book, if you have 2-3 phone numbers saved for a contact, the QuickAction window grows down listing all the numbers saved & asks you to select one from the 2-3 phone numbers.. any idea how to implement this window …

    Thanx in advance..

    Reply
    • lorenz says

      August 14, 2010 at 11:09 am

      Hi Ash,

      You can read the source code of Contacts app from android source tree, there is a method inside QuickContactWindow.java that implements it. Sorry i can’t give you the exact solution. 🙂

      Reply
  11. Clay Graham says

    August 15, 2010 at 10:35 am

    OMG YOU are awesome. I cant believe that 3 months later they still havent published the source code for this even though they say its “best practices”. Good on you man!

    Reply
    • lorenz says

      August 15, 2010 at 12:12 pm

      Thanx Clay, i couldn’t wait for their source code so it pushed me to read the Contact app source code :-(.

      Reply
  12. Christoffer says

    August 19, 2010 at 3:07 pm

    Hi, I’d like to make a few modifications to the above presented solution.

    First of all, if I want to use icons which are larger than the once in the example, the action item area grows below the row of action items. I’ve tried modifying the padding and such to give the icon some more space, but it didn’t work.

    Any ideas how to make the above example work with arbitrarly large icons? And/or with the text below the icon?

    Reply
    • lorenz says

      August 19, 2010 at 10:59 pm

      Hi Christoffer,

      In order to use more bigger action icons, you must make a modification on quickaction’s icon, make a new bigger image for it’s rail background. Or try to use Twitter’s quickaction icon (extract its apk files and copy background image from drawable-mdpi/hdpi).

      Reply
  13. Phuc Nguyen says

    August 19, 2010 at 7:15 pm

    Hi. Your stuff is awesome!

    But is it possible to dim the screen behind the PopupWindow, just like with the context menu?

    Reply
  14. Cannon22Bridget says

    August 24, 2010 at 3:07 pm

    Houses are expensive and not everybody is able to buy it. Nevertheless, personal loans are created to help different people in such hard situations.

    Reply
  15. achie says

    September 3, 2010 at 1:33 am

    Hi can I use the code in my application? Is there any thing else that I need to do regarding the license like referring you or something else to use this code?

    Thank you for the code. Have been looking for this since a few days.

    Reply
    • lorenz says

      September 4, 2010 at 10:18 am

      Yes you can, feel free to use it 🙂

      Reply
  16. Dothis says

    September 19, 2010 at 9:24 pm

    Hi, I’d like to make for than 2 items in the QuickAction. How can I do this?

    Thanks!

    Reply
    • lorenz says

      September 19, 2010 at 11:26 pm

      Create new ActionItem object then add it to QuickAction as described on example code above.

      Reply
      • Dothis says

        September 20, 2010 at 2:21 am

        I have ever do that but it always only shows two of them…weird!

        Reply
        • Dothis says

          September 20, 2010 at 2:24 am

          Sorry I was tired, I fix it…stupid error.

          Thanks for this awesome stuff!

          Reply
          • lorenz says

            September 20, 2010 at 7:50 am

            You’re welcome..:-)

  17. Android Application Developer says

    September 20, 2010 at 2:37 pm

    Nice post, I will create this api. too in my mobile.

    Reply
  18. Herbert says

    September 23, 2010 at 6:23 pm

    Nice post,
    I hava a question, how to dismiss the quickaction when the activity don’t to change.

    Reply
    • lorenz says

      September 25, 2010 at 1:00 am

      Hi Herbert, i’ll update this post & upload the new code including the dismis listener & implementation on listview..maybe 1-2 days ahead…

      Reply
  19. Rui says

    September 24, 2010 at 5:27 pm

    This is so cool! Great job, Lorenz. But when you use this component, you only target your application for Eclair and above? Do you know of any component that is similar to this for Cupcake and Donut? I’m not saying that it has to be exactly the same, but alike.

    Reply
    • lorenz says

      September 25, 2010 at 1:04 am

      Helo Rui, yes currently my apps using this quickaction are for 2.1 and above. I don’t know similiar component on old cupcake & donut 🙂

      Reply
  20. Michael Herold says

    September 25, 2010 at 6:35 am

    I have modified your layout to present the label for the icon below the icon itself, much like the Twitter application. In order to do this, make the following changes to res/layout/action_item.xml:

    LinearLayout:
    android:orientation = “vertical”
    android:paddingTop = “0dip”
    android:paddingBottom = “0dip”

    ImageView:
    android:layout_height = “fill_parent”
    android:paddingLeft = “5dip”
    android:paddingRight = “5dip”

    TextView:
    android:layout_width = “wrap_content”
    android:textSize = “10sp”

    There is only one caveat to this that I can see: in order for the labels to all line up, the icons must be the same size. Since they _should_ be the same size to begin with, this isn’t much of a problem.

    I hope that helps someone! Thank you so much for the code!

    Reply
  21. Barry says

    September 28, 2010 at 9:13 pm

    Tnx, very nice, tnx for this 🙂

    @Michael, that is also a nice adjustment 🙂

    Reply
  22. blundell says

    October 9, 2010 at 4:31 am

    That is sexy, thanks

    hopefully I can fiddle with it some more 😉

    Reply
    • blundell says

      October 9, 2010 at 4:36 am

      Just noticed it’s 2.1 and above 🙁

      I could code it to check the version and then fall back to an AlertDialog but whats the point in supporting two varieties 🙁

      Reply
      • Barry says

        October 11, 2010 at 7:58 pm

        Have you tested it? Because I ran it in an 1.6 emulator and that worked..

        Reply
  23. Radii Corporate Low says

    October 18, 2010 at 2:34 pm

    This post is a winner! Love the tips and everything you suggest.. Thanks

    Reply
  24. ghd hair straighteners says

    October 19, 2010 at 9:00 am

    Your tips are really great except the one suggesting to steal our competition articles haha . Nice tipps, thanks!

    Reply
  25. vibram five fingers says

    October 21, 2010 at 8:35 am

    Thank you for taking the time to publish this information very useful!

    Reply
  26. ThinkingDuck says

    October 22, 2010 at 3:07 pm

    Thank you! 😀

    Reply
  27. Madhur Kapoor says

    October 24, 2010 at 12:10 am

    Awesome work buddy. This has helped me a lot.

    Reply
  28. Ole K says

    October 28, 2010 at 4:39 pm

    You Sir, are my official hero of he week! This is simply great 🙂 I hope Google sees this and pulls it into the official Android API ASAP.

    And thanks to Michael Herold as well, for his alternative layout making the text appear below the icons.

    Reply
  29. Jamie Nordmeyer says

    November 1, 2010 at 1:27 am

    I’ll reiterate what everyone else on here as said so far. Thanks a ton to you and Qberticus for this work. I was just about to give up and try to work this myself when I finally stumbled upon your blog post. I’m hoping that Google will put something like this in the next release of the SDK, but until then, you’ve done a beautiful job with both samples. Thanks again!

    Reply
  30. Waseem Sarwar says

    November 10, 2010 at 1:25 pm

    Thanks really very helpfull

    Reply
  31. Mike says

    November 12, 2010 at 10:56 pm

    Great tutorial.

    I am fairly new to Android and Java. I implemented this in my app, but I do not know how to make the Pop-up dismiss automatically when an option is selected.

    Reply
    • calium says

      November 16, 2010 at 5:32 pm

      Please help!!
      I also like to know this.

      Reply
    • lorenz says

      November 18, 2010 at 11:08 pm

      To Mike and Calium,

      I’ve updated this post and added new example that shows how to dismiss popup.

      Checkout section “QuickActions With Dismiss on Action Selected”

      Reply
      • calium says

        November 19, 2010 at 9:04 am

        Thank you so much, Lorenz!!
        You are my star! 🙂

        Reply
  32. Rafael Sanches says

    November 19, 2010 at 11:41 am

    VERY good job man. It’s a shame that android doesn’t provide that by default.

    Reply
  33. Matthias Schippling says

    November 20, 2010 at 8:52 pm

    Great job! Thanks for your work 🙂

    Reply
  34. Joule says

    December 1, 2010 at 2:52 pm

    I will try to testing in my UI enviroment

    Trims dude

    Reply
    • lorenz says

      December 2, 2010 at 9:20 am

      You’re welcome bro 😉

      Reply
  35. hadi says

    December 8, 2010 at 2:42 pm

    hi. this is just what I’m looking for. thx.

    What is the best practice when dealing with PopupWindow class ?
    Is it okay if I just create and create another instance everytime I want to show a popup ?
    Can I reuse the same instance ? That is after I call dismiss, then I call showAtLocation again.

    thx

    Reply
  36. Martin Martinez says

    December 28, 2010 at 1:20 am

    Thanks man!

    Reply
  37. Muniu says

    January 7, 2011 at 5:53 pm

    Lorenz,

    Good work on the widget, saved a life here!
    Quick question though, how do you implement Gallery3D-like QuickActions?
    I’ve tried
    mQuickAction.showDropDown(); with no luck,
    mQuickAction.showLikeQuickAction(0,30); with no luck either.
    Thanks.

    Reply
  38. baychev says

    January 9, 2011 at 4:02 pm

    awesome tutorial, thanks alot.
    one question about it: is it possible to implement quick actions using this code as well on the application icon? much like the contacts placed on the home screen pop up a context menu to call, sms, emai, etc. how would you go about it?

    Reply
  39. Patrick says

    January 10, 2011 at 1:21 am

    Great job, love the look and feel of your quick action. I have found one problem while using a listadapter that has more than one size of views in the list. The quickaction window does not line up quite right like it does with a list of equal size views. Anyone have this problem or any solutions?

    Reply
  40. DextoR says

    January 16, 2011 at 6:40 pm

    thanks, amazing bunch of code. really gives a nice look to the application!

    Reply
  41. Jonathan says

    January 17, 2011 at 1:50 am

    I found a bug…

    if (rootHeight > anchor.getTop()) {
    …

    should be

    if (rootHeight > anchor.top) {
    …

    because anchor.getTop() will give the relative and not the absolute top.

    Reply
  42. Emil says

    January 22, 2011 at 2:42 am

    Hi man! thanks so much for this, i made a slight change is the CustomPopupWindow class to make dissmissing a quickaction look much better, with this code it wont become see-through when pressed.

    thanks once again!

    public void dismiss() {
    Handler mHandler = new Handler(); mHandler.postDelayed(mUpdateTimeTask,10);
    }

    Runnable mUpdateTimeTask = new Runnable(
    {
    public void run() {
    window.dismiss();
    }
    };

    Reply
  43. Sebastian says

    February 15, 2011 at 8:31 pm

    Fantastic work! Exactly what I was looking for.

    Reply
  44. Manuel says

    February 15, 2011 at 10:57 pm

    Lorenz, you are my hero! 🙂

    Just to be absolutely sure: I can use parts of your sample code and the drawables in my own app? Of course I give big thanks to you in the About Dialog of my app, but you’re okay with that, right?

    Reply
    • Lorenz says

      February 16, 2011 at 8:07 am

      Hello Manuel,

      Thank you, feel free to use it;)

      Regards

      Reply
      • Manuel says

        February 16, 2011 at 5:23 pm

        So cool! 🙂
        I will post a screenshot of how I use QuickAction in my app.

        Reply
        • Lorenz says

          February 16, 2011 at 5:42 pm

          Hi Manuel, thanx.

          Btw, i’m working on new updates for this quickaction. Fixing some bugs and the code is more efficient now. I’ll make an update to this post within next few days.

          Regards

          Reply
          • Manuel says

            February 17, 2011 at 6:41 pm

            Great to hear. 🙂
            At the moment I’m using the Gallery3D-like QuickAction. Will they be updated as well?

  45. Dean says

    February 16, 2011 at 11:25 pm

    Great find for me. I’ve tried it and it works fine, although I’ll wait for your updates before implementing it into my own app.

    Great work.

    Reply
  46. Bruiser says

    February 17, 2011 at 7:14 pm

    You are the man!!! Really great stuff.
    Thanks a lot for sharing. Keep up the good work.

    Reply
  47. Bruiser says

    February 18, 2011 at 2:25 am

    One more question though.
    Really don’t want to come across as the unappreciative nitpicker here but how come that the borders and icons are not really sharp and clean – and more important do you or anybody else know how to improve the overall look of this *admittetly already really nice* feature?

    Best wishes and king regards.
    Bruiser

    Reply
  48. posiratnam says

    February 18, 2011 at 8:10 pm

    i want program on mapviews .in that mapview contains many overlayitems .if u tap on the icon it displays one windownc

    Reply
  49. Vladimir says

    February 20, 2011 at 7:36 pm

    This is really great, thanks for sharing!!

    I’ve only one question, if I want to use Gallery 3D like actions and QuickActions together in my app, do I have to import both projects? (I would have to refactor, because it’s in the same package and the conflict will appear). Or is there any mysterious flag to show normal QA and gallery 3D like?

    Thanks again

    Reply
  50. Andy says

    February 22, 2011 at 8:06 pm

    Great tutorial Lorenz!

    One thing that occurs while I tested your implementation: If you click on an item in the quick action bar the item gets transparent (doesn’t show the orange/highlighted background). This doesn’t happen if you press the item as long as it takes for the orange/highlight background to appear. Any ideas on this?

    Thanks for this great tutorial/code!

    Reply
    • Manuel says

      February 22, 2011 at 10:50 pm

      I have the same “issue”. Didn’t find a way to prevent this, yet, but I am interested in a solution, too.

      Reply
    • lorenz says

      March 4, 2011 at 10:21 pm

      Hi, the animation on popup dismiss causes that, you can disable exit animation to solve the problem.

      Reply
      • Andy says

        March 6, 2011 at 9:32 pm

        Hi Lorenz,

        thanks for your comment. I deleted the overridden dismiss()-Method in the CustomPopupWindow class which solves the problem. Is that want you meant with disable the exit animation?

        Thanks again for this great tutorial!
        Andy

        Reply
      • Andy says

        March 6, 2011 at 9:37 pm

        Argh, well it doesn’t solve the problem. It just leads to not closing the bar…

        Can you give me some more detailed information what I need to do? This would be much appreciated.

        Thanks in advance
        Andy

        Reply
  51. Vladimir says

    March 3, 2011 at 5:12 pm

    Hello, could you please specify under witch licence is id distributed?

    Thank you 🙂

    Reply
    • lorenz says

      March 4, 2011 at 10:32 pm

      New BSD License 😉

      Reply
      • Ahsan Mostafa says

        April 19, 2011 at 5:27 pm

        New BSD License
        >> How could be ? There is no sign of BSD License Information inside the code itself.
        Can you explain a little ?

        Reply
  52. ZelluX says

    March 5, 2011 at 7:01 pm

    Thanks for the demos! But I found a small bug when using QuickAction class. After the QuickAction view dismisses, call QuickAction.show() again, it will re-add previous ActionItems in actionList again. After adding a flag to decide whether they have been added fix the bug.

    Reply
  53. Yuri says

    March 7, 2011 at 4:46 pm

    It would be nice if there will be an ability to use custom layouts for quick actions. For example, I want to use only icons placed on 3×4 table layout.

    Reply
  54. Adnan says

    March 16, 2011 at 5:18 pm

    I have created the quick action bar successfully. Now I want to open a context menu on clicking the buttons on quick action bar. How can I do this?

    Reply
  55. jitu says

    March 17, 2011 at 9:29 pm

    Done a Superb job buddy!!!
    Please help me for creating a multi-row quick action bar

    Reply
  56. Eric says

    March 24, 2011 at 10:19 pm

    Great job man! Works perfectly…
    Surely cut my development time

    Reply
  57. Vellee says

    March 25, 2011 at 1:32 pm

    I think that:
    if move”createActionList()” before “root.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));” . It well be better.

    Reply
  58. dewey says

    March 26, 2011 at 2:04 am

    In your example code you set Anonymous Listeners for each ActionItem. If I change this so my class implements OnClickListener then I implement one onClick(View v) method and have it deal with all onClicks (second description here: http://tseng-blog.nge-web.net/blog/2009/02/14/implementing-listeners-in-your-android-java-application/), I have no way of determining which ActionItem caused it to execute since only the View (in this case a LinearLayout) is passed, not the ActionItem. How can I determine which ActionItem was clicked?

    Thanks

    Reply
  59. Martin says

    April 3, 2011 at 4:42 pm

    Nice one mate, exactly what im looking for 🙂

    Reply
  60. Darren Mowat says

    April 4, 2011 at 3:43 am

    Nice one, exactly what I’m looking for.

    Reply
  61. Perry_ml says

    April 17, 2011 at 3:16 am

    Hi, you have done a great job.
    I have got a suggestion for Gallery3D-like QuickActions.
    In class QuickAction and method show(), use anchor.getLocationInWindow(location) instead of anchor.getLocationOnScreen(location). It fixes yPos bug when Activity has Dialog theme. I hope it help someone…

    Reply
    • lorenz says

      April 17, 2011 at 8:15 pm

      Hi, thanx for sharing 😉

      Reply
  62. Shaiful says

    April 25, 2011 at 8:11 pm

    Grate. Thanks. I was looking for this. I’ll do some customization to use it in my app.

    Reply
  63. adam says

    April 25, 2011 at 9:33 pm

    Hi! I’m kinda new to Android but I’m using your codes to my very simple app. Thank you very much for that!
    I’ve very very few times to go through your codes. so can you please help me in reducing the height of the Quick Action Dialog?

    Reply
  64. Arindam says

    April 28, 2011 at 1:12 pm

    Thanx man…really helpful…now i will be able to save a lot of screen space with such good looking interface…

    Reply
  65. ilh says

    April 29, 2011 at 4:49 am

    Great job on this lorenz!

    Just a quick pointer for the Gallery3D quick actions:

    In action_item.xml change the icon ImageView layout_height to match_parent otherwise some of the quick actions don’t get enough height if their icon is small and/or you add top/bottom padding to the title.
    Also if you don’t use an icon at all the quick action doesn’t display because it’s using the layout_height of the icon (not sure why it doesn’t go by the title height) so doing to above solves that too but better still add onto the icon null check the following so that it isn’t used in calculating the layout at all if it’s not used:
    else {
    img.setVisibility(View.GONE);
    }

    Keep up the good work!

    Reply
    • lorenz says

      May 2, 2011 at 10:45 pm

      Ok thanx for your correction ..

      Reply
  66. zhong says

    May 3, 2011 at 10:17 pm

    Hi Lorenz,
    Great job!
    I have used the BetterPopupwindow in my app.
    But I get some force close, the log is from the user, I never reproduce it:

    java.lang.NullPointerException
    at android.widget.PopupWindow$PopupViewContainer.dispatchKeyEvent(PopupWindow.java:1359)
    at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2496)
    at android.view.ViewRoot.deliverKeyEvent(ViewRoot.java:2456)
    at android.view.ViewRoot.handleMessage(ViewRoot.java:1766)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4627)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    at dalvik.system.NativeStart.main(Native Method)

    Any idea?

    Thank you.

    Reply
    • lorenz says

      May 6, 2011 at 6:10 pm

      hmm, sorry i have no idea ..

      Reply
  67. morgoo says

    May 6, 2011 at 3:46 pm

    Hello Lorenz,
    A big thanks for you. and can i use your sample code and the drawables in my app? my app is here : https://market.android.com/details?id=com.morgoo.launcher

    Reply
    • lorenz says

      May 6, 2011 at 6:03 pm

      Hi, yes you can use the codes and all the resources here..

      Reply
  68. Bruce says

    May 14, 2011 at 11:10 pm

    Thanks for sharing this, very helpful!

    I wanted some more info that I could use from ActionItem so I customized the callback. Here’s the addition.

    /// some info so callback will have the action item to pass
    private static class ListenInfo {
    public ActionItem ai;
    public View v;

    public ListenInfo (View v, ActionItem ai) {
    this.ai = ai;
    this.v = v;
    }

    }

    /// New Callback function
    public static class OnClickListener {
    public void onClick(View v, ActionItem ai) {
    }
    };

    /// Internal view callback handler
    private View.OnClickListener quickListener = new View.OnClickListener() {
    public void onClick(View v) {
    // retrieve action info from tag
    ListenInfo li = (ListenInfo) v.getTag();
    // call the callback
    li.ai.listener.onClick(li.v, li.ai);
    }
    };

    Then when adding an action add:
    view.setTag(new ListenInfo(view,actionList.get(i)));

    Cheers

    Reply
  69. Yvan says

    May 18, 2011 at 9:07 pm

    Nice work Lorenz!!! 🙂
    Big thx to share it. Very helpful. Can I use it for my own application?

    Reply
    • lorenz says

      May 24, 2011 at 6:52 pm

      Yes you can 😉

      Reply
  70. Jakub says

    May 20, 2011 at 12:47 am

    Nice work Lorenz 😀
    I’m using your code in my academic android project, hopes you don’t mind 😉

    Unbelievably helpful piece of code, and it works like it should. Easy and smooth – thumbs up from me!

    Reply
    • lorenz says

      May 24, 2011 at 7:00 pm

      Ok Jakub, feel free to use it. Hope it helps you. 😉

      Reply
  71. Tareq sust says

    May 21, 2011 at 1:34 pm

    Bro,
    you owe a hug from me. Very nice code and works like a charm . Thanks for sharing the code .

    Tareq

    Reply
    • lorenz says

      May 24, 2011 at 7:02 pm

      You’re welcome 😉

      Reply
  72. Nico says

    May 23, 2011 at 7:17 am

    Thanks for this.

    I also ran into the problem where tapping a button to dismiss the bubble leaves behind a black rectangle. A lame (but functional) workaround is to call dismiss() after a short delay instead of calling it directly, like so:

    public void onClick(View v) {
    // Instead of calling dismiss() directly, do:
    new Handler().postDelayed(new Runnable() {
    @Override
    public void run() {
    // Give the button time to draw its “pressed” state.
    // Without this delay, the pressed button is transparent
    // while the exit animation runs.
    dw.dismiss();
    }
    }, 10);
    }

    Reply
  73. Vinay Hiremath says

    May 24, 2011 at 7:22 am

    This is fucking awesome man. I got here originally from StackOverflow. Very informative. I’ll be watching you.

    Reply
  74. satura says

    May 31, 2011 at 5:19 pm

    Dear Lorenz
    Excuse me, our team just began to work on GIS app. in Taiwan. We met some difficulties in creating QuickAction dialog. Could we use your code in our cadastral GIS product? We want to show this action in the main menu. Please let me know if you have any concerns,thank you.
    Yours Sincerely

    Satura

    Reply
  75. Gopal says

    June 5, 2011 at 10:12 am

    Awesome man, this is damn cool. Copying it in one of my project. Thanks.

    Reply
  76. monty says

    June 15, 2011 at 8:31 am

    not sure if anyone else encountered this problem but in the QuickAction class, showArrow method, i found that it would not show the arrow b/c of this line.
    param.leftMargin = requestedX – arrowWidth / 2;

    if u add parentheses shown below it will work
    param.leftMargin = (requestedX – arrowWidth) / 2;

    Thankfully i listen to a maths class when i was younger, go BODMAS

    Reply
  77. Rafael Sanches says

    June 28, 2011 at 4:25 pm

    Hi Lorenz,

    Great code!

    I see that you have the updated code on NewQuickAction git hub. Are you able to tell me if that code is newest than the Gallery3D code example!? I use the gallery one, but i’m afraid to not be updated!

    thanks!
    rafa

    Reply
    • lorenz says

      July 4, 2011 at 12:14 am

      Hi Rafael, yes the code is newest than Gallery3D example.

      Reply
  78. Iñigo says

    July 6, 2011 at 3:56 am

    Hi! Congratulations, great job! I will start following your blog

    What is the git hub url? Are these examples in a repository? I would be really usefull to be up to date with these really nice components

    Thanks

    Reply
    • lorenz says

      July 6, 2011 at 11:20 pm

      Hi, thank you. This is the github url: https://github.com/lorensiuswlt/NewQuickAction

      Reply
  79. Alessandro says

    July 10, 2011 at 2:29 am

    Hi, thanks for the source! I made a little modification to the quickaction: http://bit.ly/pxJr83

    Reply
  80. Aa says

    July 12, 2011 at 5:57 pm

    How to create nested quick actions???

    Reply
  81. su says

    July 12, 2011 at 6:03 pm

    How to create nested Quick Actions????
    For example as given above:- When Button1 is pressed, Chart & Products is visible. When Chart is click, then also it should display a new Quick actions with different items…

    Reply
  82. tarun says

    July 12, 2011 at 10:05 pm

    hey lorenz.. first of all thanks a lot for providing this beautiful piece of code to everyone.

    secondly i want to use quickaction on click on list view item or infact a button in list view. how do i find out which row of the listview fired the quickaction?

    thirdly i wanna knw wats d difference in the quick action and new quick action code?

    Reply
  83. Takara says

    July 18, 2011 at 11:18 pm

    Hello Lorens, Thanks for your code

    Reply
  84. Takara says

    July 18, 2011 at 11:22 pm

    We are happy with the code Lorenz, many thanks

    Reply
  85. Jay says

    July 19, 2011 at 10:23 pm

    woah.. such a masterpiece .. thanks a lot. This will help me a lot. 🙂

    Reply
  86. cypressious says

    July 20, 2011 at 12:17 am

    Thanks a lot for your implementation. The result is outstanding.
    I just have a little graphical issue. When I launch a different activity by tapping an ActionItem the background disappears for a short period of time and then the new activity launches. Although when I tap the item an hold it, the background becomes orange as suspected.

    Reply
    • lorenz says

      July 20, 2011 at 12:41 pm

      Hello,

      Yes there is a bug in my implementation. The actionitem background becomes dark when the dialog dismissed. I’m working on fixing this issue. Watch my github repository for latest update.

      Reply
  87. Sirill says

    July 20, 2011 at 4:35 pm

    Hi,

    Very good job.

    Is there a way to have icons on 2-3 lines ?
    I m searching since 2 days without success.

    Reply
  88. Tim says

    July 24, 2011 at 12:13 pm

    VERY nice, Lorenz. Thank you SO MUCH, it’s exactly what I needed. I’m still fairly new at this, so not only was it something I can use, but it’s also a nice learning experience. Well done.

    Reply
    • lorenz says

      July 31, 2011 at 9:05 pm

      You’re welcome Tim..;)

      Reply
  89. Shubham says

    July 27, 2011 at 4:29 pm

    Hello Loennz,
    Thanks for your tutorial, How can make it Circular..give me some guidance .

    thanks

    Reply
  90. Sahil says

    July 28, 2011 at 11:13 am

    My eclipse shows no ActionItem Class.. ???

    Reply
    • Shubham says

      July 28, 2011 at 12:52 pm

      what it’s showing…did u see files are available in your project folder or not

      Reply
  91. hjhi says

    July 28, 2011 at 6:39 pm

    Hello Lorens, Thanks for your code. But how to insert new quick action dialog in quick action dialog??

    Reply
    • lorenz says

      July 31, 2011 at 9:20 pm

      Hi, what did you mean by insert new quick action dialog in quick action dialog?

      Reply
      • hjhi says

        August 1, 2011 at 6:24 pm

        Hi, what i mean is …. in your code when we will press Button1, it will show quick action having three items (Add,Accept,Upload). Now i want to pop up a new quick action having two or three items on pressing any option(Add,Accept or Upload).

        Reply
        • lorenz says

          August 1, 2011 at 10:45 pm

          Hi, i think that’s not a good pattern, showing new qa dialog on top/below other qa. The best way to implement your goal is by using extended layout just like in contact app. If a contact has more than one phone numbers, clicking on phone item on quickaction will expand new list view below the action item. you have to implement it manually 😉

          Reply
  92. CamDroid says

    July 29, 2011 at 1:43 pm

    Thanks a bunch for the code – I’m really looking forward to building an app with this included! 😀

    One thing, though – when I try to implement your files into my app, they cause it to crash. PopupWindows line 35 (mWindow = new PopupWindow(context) ) causes an IllegalStateException – “System services not available to Activities before onCreate()”

    I’ve called setContentView() in another class, and I’m pretty sure I’ve copied the files over correctly, so if you have any helpful tips, that would be amazing. 😀

    Thanks for all of your hard work!

    Reply
    • lorenz says

      July 31, 2011 at 9:23 pm

      Hi you’re welcome, could you give me the code snippet?

      Reply
    • kadir says

      January 13, 2012 at 4:29 pm

      dude make sure you are creating object at onCreate instead of just previous initialization of this function is called. e.g:
      object aa;

      oncreate {
      aa = new bb();
      }

      Reply
  93. Andy says

    August 3, 2011 at 5:45 am

    Hi lorenz,

    awesome work, again and thanks for publishing it on github. I am using your previous version of the code so. The new version which uses only one listener for all items doesn’t work for me. The problem with your solution is, you rely on the position of the clicked item. My quickaction list contains different amounts of actions depending on the state of the clicked item.

    So even though your solution is shorter/simpler it isn’t as flexible as your first solution.

    Just my two cents. Again, thanks for sharing this with the dev community.

    Andy

    Reply
    • lorenz says

      August 6, 2011 at 12:10 am

      Hi Andy, you’re welcome. Yes i’ve changed the current action item listener implementation, previous version will suits your needs 😉

      Reply
  94. Aitor says

    August 5, 2011 at 5:52 pm

    Hi Lorenz,
    Thanks so much for sharing this.
    I’ve just included your code in one app I am working with and all seemed to work fine.
    However, when I was playing around at one moment I doubled clicked too fast on the button that shows the quickaction dialog, not intentionally, but I did and the application force closed.
    It was weird and I did not know if it was something in my code.
    Then I opened your example and start noticing the same problem, but only on Example1 (on the list this is not happening). If I click repeatedly and too fast on the buttons (I know that this is not how you are going to use your app but it happened unintentionally the first time) the app crashes with the following error

    ERROR/AndroidRuntime(8350): FATAL EXCEPTION: main
    ERROR/AndroidRuntime(8350): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
    ERROR/AndroidRuntime(8350): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3129)
    ERROR/AndroidRuntime(8350): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
    ERROR/AndroidRuntime(8350): at android.view.View.measure(View.java:8313)
    ERROR/AndroidRuntime(8350): at android.view.ViewRoot.performTraversals(ViewRoot.java:839)
    ERROR/AndroidRuntime(8350): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
    ERROR/AndroidRuntime(8350): at android.os.Handler.dispatchMessage(Handler.java:99)
    ERROR/AndroidRuntime(8350): at android.os.Looper.loop(Looper.java:130)
    ERROR/AndroidRuntime(8350): at android.app.ActivityThread.main(ActivityThread.java:3683)
    ERROR/AndroidRuntime(8350): at java.lang.reflect.Method.invokeNative(Native Method)
    ERROR/AndroidRuntime(8350): at java.lang.reflect.Method.invoke(Method.java:507)
    ERROR/AndroidRuntime(8350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    ERROR/AndroidRuntime(8350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    ERROR/AndroidRuntime(8350): at dalvik.system.NativeStart.main(Native Method)

    I am using a Nexus One (Android 2.3.4), let me know if this is happening to you.

    Thanks so much

    Reply
    • Zammbi says

      October 5, 2011 at 10:10 am

      Did you find a solution?

      Reply
  95. angie says

    August 8, 2011 at 4:50 pm

    hello,
    first of all it’s an awsome work!
    i’m trying to integrate the quickActionBar, Gallery 3D like to my Action Bar(a reusable layout)
    i’m getting a bug , the triangle it’s no longer attached to the square. i think it’s a problem of context , i have no idea how to fix it help!

    Reply
  96. sahir says

    August 9, 2011 at 4:20 pm

    thanks great Work

    Reply
  97. Ron says

    August 11, 2011 at 5:03 am

    Very good work and article. I am planning to include this thing in my project. Thanks a bunch

    Reply
  98. Igor says

    August 18, 2011 at 9:45 pm

    Thank you, this article is very helpful! Good work!!!!!!!!!

    Reply
  99. Connor says

    August 19, 2011 at 2:00 am

    Great example! I’m currently trying to implement this into my application, but unfortunately I use a custom view (onDraw and a canvas). Ideally, I’d like for the user to be able to touch any part of the screen and depending on where they touch, the quickaction menu pops up and has custom content (depending on the location of the touch). So currently I’m using an onTouchEvent, then locating the touch, then performing an action based on that location. How could I implement your code so when I touch the screen, the quickAction menu pops up and populates itself based on location?

    So for example:

    public boolean onTouchEvent(MotionEvent event) {
    int eventaction = event.getAction();

    int X = (int)event.getX();
    int Y = (int)event.getY();

    switch (eventaction ) {

    case MotionEvent.ACTION_DOWN: // touch down so check if the finger is on a ball
    int centerX = 80;
    int centerY = 80;

    if (X > centerX – 30 && X centerY – 30 && Y < centerY + 30){//POPS UP QUICK ACTION MENU WITH CUSTOM CONTENT HERE
    }
    }
    break;
    }
    return true;
    }

    Thanks.

    Reply
  100. Matthew Versaggi says

    August 29, 2011 at 10:11 pm

    Great stuff! Big Kudos!

    Reply
  101. Matthew Versaggi says

    August 30, 2011 at 6:02 am

    OK …. just perused you code … EXACTLY what I was looking for … BIG thanks again! 🙂

    Reply
  102. Cfanboy says

    August 30, 2011 at 9:36 pm

    Thank you very much, I am looking for this codes long long time. Appreciated you shared on Github.

    Reply
  103. Matthew says

    September 2, 2011 at 5:26 pm

    Hello Lorenz, your code is what exactly im looking for, however the popup.9.png doesn’t seem to appear. see attached screenshot: http://i.imgur.com/zaTrB.png

    Reply
  104. Olivier Chatry says

    September 23, 2011 at 12:37 am

    I think this code would be better for the onClick listener :

    container.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v)
    {
    if (mListener != null)
    mListener.onItemClick(pos);
    v.post(new Runnable()
    {

    @Override
    public void run()
    {
    dismiss();
    }
    });

    }
    });

    Reply
  105. Adam says

    October 1, 2011 at 4:43 am

    Has anyone figured out how to use this with Fragments? I have a Left Fragment and a Right Fragment, both ListFragments. I want the QuickAction dialog to pop up when I click on a ListItem on the right. It pops up in the right spot vertically, but it’s within the Left Fragment, not the Right. Any ideas?

    Thank you…it’s a great bit of code!

    Reply
  106. Ashish says

    October 1, 2011 at 7:18 pm

    Thanks for bunch of code.

    Reply
  107. Arpit Hada says

    October 3, 2011 at 3:27 pm

    Hey thanks alot. A perfect example to implement QuickAction.
    Thanks again

    Reply
  108. Awais says

    October 4, 2011 at 11:54 am

    Bundle of thanks lorenz.. It really helped alot.
    Keep posting

    Cheers

    Reply
  109. TheVaan says

    October 5, 2011 at 5:42 am

    Thanks for this amazing code!
    I love it!

    One question: Is there a way to modify the code so that this popup is able to show only something like an information, so that there is only text, without clickListner and so on?
    I’m not a really pro in coding and hope you can help me 🙂

    Greetings

    Reply
    • lorenz says

      October 5, 2011 at 8:46 pm

      Just leave the listener and icon empty..;)

      Reply
      • TheVaan says

        October 7, 2011 at 12:54 am

        Oh! Easyer then I thought ;D Thank you!

        Reply
  110. Zammbi says

    October 5, 2011 at 9:59 am

    Working good but I am having one issue. When calling quickAction.show(v); in a button click it can crash with this in the log:

    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3129)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.View.measure(View.java:8330)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.ViewRoot.performTraversals(ViewRoot.java:843)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.os.Handler.dispatchMessage(Handler.java:99)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.os.Looper.loop(Looper.java:130)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.app.ActivityThread.main(ActivityThread.java:3835)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at java.lang.reflect.Method.invokeNative(Native Method)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at java.lang.reflect.Method.invoke(Method.java:507)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
    10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at dalvik.system.NativeStart.main(Native Method)

    Reply
    • Zammbi says

      October 5, 2011 at 10:57 am

      Posted fix: https://github.com/lorensiuswlt/NewQuickAction3D/issues/2

      Reply
      • lorenz says

        October 5, 2011 at 10:40 pm

        Hi Zammbi, thanx for the fix, i’ll update the repository…:D

        Reply
  111. Khalid Elshafie says

    October 5, 2011 at 12:46 pm

    This was really very helpful. Thank you so much.

    Reply
  112. TheVaan says

    October 7, 2011 at 3:12 am

    Hi!

    May I found a solution for your issue on github: https://github.com/lorensiuswlt/NewQuickAction3D/issues/1

    Reply
    • lorenz says

      October 9, 2011 at 11:16 am

      Hi Vaan, thank you for the solution, i’ll make a test and update the repository….:D

      Reply
  113. lendski says

    October 10, 2011 at 12:35 pm

    mantap mas… saya punya 2 listview mas deng orientasi vertical, isinya banyak data tapi yang keliatan hanya 3 row aja gimana ya mas?jadi bisa di scrool buat liat semua datanya?thank you..

    Reply
    • lorenz says

      October 13, 2011 at 8:37 pm

      Bisa diperjelas lagi maksudnya? ada contoh screenshotnya ?

      Reply
  114. Kevin Peck says

    October 12, 2011 at 2:51 am

    I have made a number of changes to the code that others may find helpful.

    1) Action Item – new constructor with action id, title, icon

    2) Callback enhanced to return QuickAction object as source and action id (allows you to add items in any order as you base what was clicked on by the ID, not the pos)

    3) Action item supports sticky mode, if that is enabled the menu does not dismiss post button press. I needed this for my application.

    4) QuickAction has getActionItem(pos) call so you can get action item back. QuickAction has ArrayList of added items to support this.

    5) QuickAction supports constructor with horizontal flag so you can run menu horizontally instead of just vertically.

    6) If doing horizontal QuickAction loads the action_item_horiz.xml and popuphoriz.xml files instead of the vertical ones.

    7) Added action_item_horiz.xml with a centered image over a centered text label

    8) Added horiz_separator.xml file so you can show a separator between items in a horizontal layout

    9) Updated NewQuickAction3DActivity to show the toast message based on label of action item clicked as you now have enough info in callback to do that generically

    I want to attempt to have all horizontal items show up same width by rolling through post add and getting max width and using that for all items. Not sure if that is possible.

    I would also like to add a spacer action so you can group items with an extra gap. Might do that as a parameter to addActionItem(action)

    I can send the code to you if you to look it over and see if my changes are acceptable and useful. I might take a day or so to polish it up and implement a few things mentioned above.

    The existing code has been very helpful and I wanted to give back to others who are using it.

    Reply
    • lorenz says

      October 13, 2011 at 8:43 pm

      Hi Kevin, thanx for nice update, could u send me the code?

      Reply
      • Kevin Peck says

        October 14, 2011 at 2:30 am

        I sent you the code. I did an extra update so you can be notified when the menu dismisses. I use this as a “cancel” action in my code so I can clean a few things up once the menu is gone.

        Reply
        • Roman says

          October 14, 2011 at 2:53 pm

          Hi guys, great work 🙂
          Could you please push the modifications to Git or send them also to me?

          Reply
          • lorenz says

            October 19, 2011 at 10:01 pm

            Check out the github repo 😉

  115. Karl Kristian says

    October 12, 2011 at 4:55 pm

    Thanks for sharing this code I really like it.

    Defiantly going to use this on my app.

    Reply
    • lorenz says

      October 13, 2011 at 8:49 pm

      You’re welcome, don’t forget to check the latest update on github..;)

      Reply
  116. Shilpy Pandey says

    October 13, 2011 at 5:36 pm

    Hi,
    i want the arrow in the middle of the popup as its everytime either displayed on right or left side.Any option to make it in center

    Reply
    • lorenz says

      October 13, 2011 at 8:58 pm

      The position of the arrow is based on where the anchor view is placed. If you place the anchor view at the center of screen, the arrow will be displayed at the center too.

      Reply
  117. Harsha says

    October 29, 2011 at 2:38 am

    lorenz,
    I am trying to use your quick action for menu item on action bar (3.0) and not being able to place at the right place.

    How can I do this in.
    mActionBarView = getLayoutInflater().inflate(
    R.layout.action_bar_custom, null);

    public boolean onOptionsItemSelected(MenuItem item)
    {
    switch (item.getItemId())
    {
    …

    mQuickAction.show(mActionBarView);

    }
    }

    I know its because I am passing actionbar view as anchor view, how do I pass the menu item as the anchor view, is it possible?.

    Help on this is highly appreciated.

    Waiting for quick response 🙂

    Thanks,
    Harsha

    Reply
  118. Harsha says

    October 29, 2011 at 2:48 am

    sorry for the typo, Its because of the actionbar view am passing as anchor view.

    Thanks,
    Harsha

    Reply
  119. Jean-Michel says

    November 1, 2011 at 7:41 pm

    Hi Lorenz,
    this is really great work and it seems it will suit my needs.

    I just have a question re the implementation.

    It is meant to be used as a library project, or should I rather copy everything in my own project tree ?

    Thanks in advance,
    JM

    Reply
    • Lorenz says

      November 2, 2011 at 8:51 am

      Hi Jean, thanks for choosing quickaction. You should copy everything into your project. You can also make changes to the drawables if you want to make custom theme. 😉

      Reply
  120. Jean-Michel says

    November 2, 2011 at 11:43 pm

    Hi Lorenz,
    I did this as it was simpler indeed.

    I have just made a small modification to your code.

    I have added a tag object (like in View)to ActionItem. This allows “embedding” stuff into the ActionItem.
    It proved necessary in my case and might be useful to other users (the code is VERY simple, just added the instance variable and getter/setter).

    Thanks again for your great work.

    Reply
    • Lorenz says

      November 3, 2011 at 2:02 pm

      Hi Jean, that’s great, you are free to modify the code to suit your need. Hope it usefull for your application..;)

      Reply
  121. Harut says

    November 18, 2011 at 12:08 pm

    Hi, I’m trying to adopt it to my project, I’d like to know do you have implementation for this to pop-up not from the top or bottom but from left or right?

    Thanks.
    Harut M.

    Reply
  122. Zerho says

    November 25, 2011 at 6:26 am

    Hi i’m trying to use this on my app but when i click on a quick action item too “quickly” the image doesn’t behave like it should, it disappear and shows the background color, if i click it “slowly” it works properly,
    is there a way to fix it?
    do you experience the same thing?

    thanks

    Matteo

    Reply
    • lorenz says

      November 28, 2011 at 10:19 pm

      Hi Zerho, yes there is a bug on quickaction. the solution is to create separate background drawable for popup menu. i’ll try to update the fix soon on github.

      Reply
  123. Plamen says

    November 28, 2011 at 8:42 pm

    The transparent background bug still happens – android 2.2 HTC Desire. What is the problem there?

    Reply
    • lorenz says

      November 28, 2011 at 10:31 pm

      yes the bug still exists but i’ve managed to solve the problem, i’ll try to update the repo soon.

      Reply
      • Minh says

        December 10, 2011 at 7:02 am

        Any tips on how to fix this transparent ActionItem bug? Thanks!

        Reply
        • lorenz says

          December 12, 2011 at 12:16 am

          just set background for popup window in QuickAction.java.

          Reply
          • Igor says

            December 13, 2011 at 1:31 am

            It works well on 2.1 platform without setting background, but on 2.3.3 problem with
            transparency exists (emulator uses). If you set background in QuickAction class then the whole widget will be bigger and less attractively 🙂

  124. Sandy says

    December 4, 2011 at 12:33 pm

    Awesome code, thanks alot!

    Reply
  125. Felix says

    December 4, 2011 at 4:23 pm

    What is the minimum api level for the quick action?
    Good work. I like this feature.

    Reply
    • lorenz says

      December 12, 2011 at 12:13 am

      Works on 2.1 and above

      Reply
  126. Rob says

    December 17, 2011 at 8:17 pm

    Hey Lorenz,

    Thanks for this cool code!!!

    Is there any way to change an ActionItem’s icon or text, AFTER it has been added to the QuickAction?

    I’ve tried…

    myActionItem.setIcon(getResources().getDrawable(R.drawable.ic_checked));

    and

    quickAction.getActionItem(0).setIcon(getResources().getDrawable(R.drawable.ic_checked));

    but without success. I’m trying to implement a checked/unchecked state on a sticky ActionItem. Any suggestion on how to do this?

    Thanks,
    Rob

    Reply
  127. Igor says

    December 19, 2011 at 9:30 pm

    I have finally found the solution for transparent background problem. The thing is that popup window is dismissed too early so just put this piece of code in PopupWindows class, dismiss() method:

    public void dismiss() {

    new Thread(new Runnable() {

    @Override
    public void run() {
    try {
    Thread.sleep(1500);
    mWindow.dismiss();
    } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    }
    }).start();

    }

    I hope it helps…

    Reply
    • erdem says

      February 2, 2012 at 8:12 pm

      I think 250 ms delay is a better choice than 1500 ms.

      Reply
  128. shinjidev says

    December 20, 2011 at 4:22 am

    Nice work and article :). I’m using quickaction in my project, it works very well in smartphone app, but i have a problem when i try to show it in a Dialog, the quickaction appears in other place outside the dialog, what can i do in this case? 🙁

    Reply
  129. Dorin says

    December 21, 2011 at 5:46 pm

    Good job !!!

    Reply
  130. George H. K. says

    January 1, 2012 at 10:59 pm

    The code works perfect and the design is very easily customiziable, Great work!

    The only problem I currently have is that the PopupWindow consumes the touch event needed to dismiss itself, without delegating it to the other controls.

    I tried various ways to work around this, including unsuccessful try to set FLAG_NOT_TOUCH_MODAL but still not working.

    Any help will be greatly appreciated!

    Reply
    • George H. K. says

      January 19, 2012 at 6:21 am

      Have anyone else had this problem and managed to fix it somehow?

      I see that the default camera app in Android 3.1 have quite nice kind of quick action menus, but the focus is not consumed, so you ca switch to (open) the next menu directly while closing the current one. So it is possible for sure 🙂

      Reply
  131. Andy says

    January 2, 2012 at 7:47 am

    Great article. I’ve used the QuickAction bar in the Greendroid library but never seen how to create the Gallery Like one. Really like this quick action, thanks for sharing.

    Reply
  132. gil says

    January 12, 2012 at 3:05 am

    incredibly helpful thank you!!

    would be nice to just download the source project and work with that

    but still helped a lot 🙂

    Reply
  133. cypressious says

    January 31, 2012 at 10:29 pm

    I recently noticed, that on a big screen (like a Honeycomb tablet) the popup is positioned very weirdly and also the triangle below (above) the popup isn’t displayed.

    The strange thing is: Although this happens in landscape mode, it doesn’t in portrait mode.

    Reply
  134. Spencer says

    February 3, 2012 at 10:32 am

    This works perfectly for a project I’ve been working on. I have a couple of questions though. First, I notice that the 3D version doesn’t scroll horizontally if there are more items than can be displayed. Also, is there a way to make the quick actions pop up to the side of the anchor instead of above/below? A fix to either the horizontal one not scrolling or popping a vertical list to the side of an anchor would help a lot. Let me know if I’m missing something. Thanks again!

    Reply
  135. madi says

    February 7, 2012 at 10:20 pm

    hi plz tell me how to add sub menu to any of the menu items in QuickAction?
    Thanks

    Reply
  136. caco says

    February 8, 2012 at 3:42 pm

    tutorial yang sangat membantu. terima kasih.

    oh iya, klo untuk pop up window yang menampilkan textview ada tutorialnya ga mas? klo bisa sih di buat juga, saya sudah searching di google belum ada yang tepat penjelasannya…

    Reply
  137. Steve Cornish says

    February 13, 2012 at 3:45 pm

    Hi Excelent
    Is it possible to get the pop up window to point to the select item in a custom list. At the moment it points to the list hold not the row item selected. if so how.
    Thanks

    Reply
  138. Josh Hunt says

    February 15, 2012 at 11:51 am

    Thanks for the great piece of code!

    I am attempting to change the title on an action item after I have created the action item. It doesn’t seem to be updating. I am using the following code:

    quickAction.getActionItem(2).setTitle(“Remove Star”);

    Reply
    • Samolo says

      February 25, 2014 at 2:46 am

      Did you fix this issue? I’m stuck here.

      Reply
    • samolo says

      February 25, 2014 at 2:50 am

      Did you find a solution for this issue?

      Reply
  139. Mohit says

    February 15, 2012 at 7:30 pm

    Thanks for this work. It helped me in my free app that I published on app store. Drop me an email if you would like a link or search using my email ID before gmail.com. Really appreciate your hard work.

    Reply
  140. smeeagain says

    February 26, 2012 at 8:45 am

    Thank you for this it is really a nice piece of work. Is there a way to remove and add new items during program run?

    Reply
  141. Felix says

    March 2, 2012 at 7:45 pm

    Can you support all display sizes, please.
    I have in each ActionItom white lines in the background, so i think the grey background image or color is not for my display size of 320 x 240 Pixels configured. Thanks

    Reply
  142. Pedro says

    March 21, 2012 at 3:30 am

    Bug report:
    I’ve tried the list example, when you click over an item it always come through false on the if clause, so don’t have really a action tha can be handled there…, the Strange things is over the buttons it works fine, with almost the same code…
    Despite of it, it’s a great work!! congratulations

    Reply
  143. Rommy says

    March 31, 2012 at 11:15 am

    I just have a problem..
    When I press the button, the QuickAction is shown normally but when the QuickAction is still shown then I switch the emulator from portrait to landscape mode, the QuickAction position is somehow not positioned in the button that I pressed before..

    Any suggestion how to prevent this??

    Reply
  144. youssef says

    April 6, 2012 at 11:23 pm

    This is really great work and very easily customizable and documented. I did notice one issue though that you have not notice it on a BLACK background but it is very obvious on lighter colors backgrounds. When you click on an Action Item before the Presse State takes place, the item DISAPPEARS monetarily. Do you know why is this happening ? your answer will be greatly appreciated. Thanks

    Reply
  145. Brandon Tate says

    April 10, 2012 at 3:44 am

    I’m trying to display this inside a web view. When I show the quick action menu it doesn’t really wrap the content. The buttons are all there, but the background is just that 9 patch image, complete with the guides still showing. Has anyone run across something similar?

    Reply
    • Brandon Tate says

      April 10, 2012 at 10:29 pm

      So it turns out that this looks fine as long as I have icons that are exactly the size of the icons in the example.

      Reply
      • Mike says

        May 17, 2012 at 9:40 am

        Hi Brandon, do you have any tutorial about that? thanks a lot!

        Reply
  146. Mate says

    April 12, 2012 at 12:13 am

    Hi! Thanks a million for your great work!
    I run into a problem which is maybe interesting for you, maybe you can help me!

    I posted it already on stackoverflow
    http://stackoverflow.com/questions/10109526/combination-of-service-progressbar-gridview-and-his-notifydatasetchanged-an

    Reply
  147. stevo says

    April 16, 2012 at 2:35 pm

    this post is so helpful and so nice but is possible to update the 3d part to can add multi row icons i want use it to add emoticons in the view in mtrack u use linear layout i want to put table layout

    Reply
  148. Giuseppe says

    May 12, 2012 at 12:43 am

    On ICS the animation on the slide are very bad, any suggestion?

    Reply
  149. Silvan says

    May 14, 2012 at 8:39 pm

    Hi, this is really great! Does anyone know how to implement this from an onSingleTapConfirmed, where I only have a MotionEvent and no View?

    Thanx in advance!

    Reply
  150. Quicknol says

    May 20, 2012 at 2:21 am

    HI,

    Thanks lot for such an amazing control, its working perfect in my phone.. Thanks lot for posting the code…

    Reply
  151. Cristiano Marinho says

    May 31, 2012 at 3:51 am

    congratulations for the wonderful job.

    You can start the activity with QuickAction already open,
    without using the method onClick ()?

    Reply
  152. piyush says

    June 5, 2012 at 9:35 pm

    I was wondering if it’s possible to add a view (xml) in Quick Action. I have designed a table layout in xml and not sure how to fit that into QuickAction.

    Reply
  153. omayib says

    June 9, 2012 at 7:35 am

    Waw! great! thx for your share… Keep post! 🙂

    Reply
  154. Exile says

    June 12, 2012 at 7:55 pm

    Thx for your code. It’s quite helpful for me but i have a problem. Popup’s width is not full screen. How can i solve that?

    Reply
  155. chitgoks says

    June 14, 2012 at 1:29 pm

    hi. using your Gallery3D-like QuickActions, what if this will be used in a tablet, how can the menus get bigger?

    just use bigger icons?

    Reply
  156. jack says

    June 29, 2012 at 4:43 pm

    Thx for your code. It’s quite helpful for me but i have a problem. But I have problems with Popup,when I use android 4.0.3 to run the project.(the display size is 5.4 in FWVGA),The Popup’s size is much bigger I expected,and when the button is in a FrameLayout,(the FrameLayout in the scren’s bottom) the arrow of the Popup is still the down ones.Do you know why?

    Reply
  157. Kd says

    July 2, 2012 at 2:23 pm

    Hi
    the code is working fine only the Horizontal separator is not coming for the quick action any suggestions for the problem ?

    Thanks
    KD

    Reply
  158. zhmsong says

    July 3, 2012 at 9:47 pm

    hey, lorenz:
    Thanks, It is great!
    But I found a problem, the source has not set minSdkVersion, so when I set one as my app, the quickaction_slider_btn_normal.9.png will not scale well:-(
    It is ok when minSdkVersion deleted.

    Regards
    Zhimin

    Reply
  159. kssds says

    August 9, 2012 at 3:37 am

    Can you add xhdpi image resources?

    Reply
  160. Jean says

    August 11, 2012 at 8:22 am

    Do anybody know how to set the dialog height? its too big in my tablet.

    tks

    Reply
  161. Duy Khánh says

    August 14, 2012 at 2:38 pm

    Great!!! Thank you so much

    Reply
  162. Anoop says

    August 21, 2012 at 2:44 pm

    Thanks, It works nice.

    Reply
  163. Jim says

    August 22, 2012 at 8:03 pm

    You need to add this in the AndroidManifest.xml:

    This will fix the display issues, like the text being too big in places, and the Toast messages being too small.

    Reply
  164. paragchauhan says

    August 26, 2012 at 6:01 pm

    Hi
    Thanks for nice tutorial.
    I need to Add simple Listview in QuickAction Dialog.
    Pls suggestion me any suggestion for this

    Reply
  165. paragchauhan says

    August 26, 2012 at 6:49 pm

    i have create some stuff but not solved
    pls check this
    http://stackoverflow.com/questions/12129689/how-to-add-listview-in-quickaction-dailog-in-android/12129718#12129718

    Reply
  166. Laabroo says

    August 27, 2012 at 3:50 pm

    hello brother. Can you give me sample about how to inject radio button on list menu drop down like?

    Reply
  167. Gauti says

    August 31, 2012 at 1:12 pm

    Hello Bro….

    The application you have posted is really awosome flag for u….

    Reply
  168. Ivan says

    August 31, 2012 at 3:08 pm

    Hello,

    This library is great, the sample application seems to work but when I added it to my library in my application I get an NullPointerException error when I’m adding the action item on the quick action.

    Can anyone tell me what’s happening?

    Reply
    • Cris says

      June 30, 2013 at 11:02 pm

      I imported the class folder NewQuickAction3D/bin/classes but am running into a NoClassDefFoundError. Clearly I am doing something wrong.
      What is the correct way to import QuickAction3D into a project? Should a user export a .jar file and then import it? if so what is exported into the .jar file? Or should one import a Classes folder? for us/me a little new at Eclipse/ Java it would be great to have this tip. Thank you.

      Reply
      • Cris says

        June 30, 2013 at 11:13 pm

        OK, I got a little bit farther, I added a class folder of NewQuickAction3D/bin/classes and from QuickAction3D exported a .jar and imported it into my project, but now running into a runtime error when setting the mRootView.

        public void setRootViewId(int id) {
        mRootView = (ViewGroup) mInflater.inflate(id, null);

        Obviously I’m doing something wrong, so a quick steps on how to properly import QuickAction3D into a project in eclipse would be appreciated. Thanks!

        Reply
  169. Sultan Ahmed says

    September 9, 2012 at 5:02 am

    I want to implement a Quick Action Dialog .After searching in web I have found a very nice tutorial in this link :

    http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

    Everything was working ok, but i tried to use it in a dialog and it didn’t work. I want a simple and short tutorial for this . Can you give me a code with just a button in layout and in code if I press the button a quick action dialog will appear ??

    Reply
  170. karthik rao says

    September 11, 2012 at 11:11 am

    hi, Thank u for giving good example on Quickaction Dialog…
    How to break into 2 parts in dialog… just check this link for more info…
    http://stackoverflow.com/questions/12351670/quick-dialog-using-onclick-search-view-in-android#comment16587604_12351670
    thank u once again Bro…

    Reply
  171. Dilip says

    October 12, 2012 at 2:29 pm

    i have implemented your code according to my requirement i need to add dynamic data in popup list but i’m unable to do this please suggest me how to do this thanks for excellent code.

    Reply
  172. Cristina says

    November 13, 2012 at 3:38 pm

    Hi, first, thank you very much for your code. It helped me with my job. But I have a question about the second code.

    I need do my own quickaction with my own res, but with your code I don’t get remove the black background. Where is declarated the background? I thought in the popup_vertical.xml file but the black background continue. How can I change the style of my quickaction.

    Sorry for my english.

    Regards

    Reply
  173. Vanqe says

    November 28, 2012 at 11:39 pm

    Hi, thank you for your code.

    I have a problem when I try modify ActionItem title.

    @Override
    public void onItemClick(QuickAction source, int pos, int actionId) {
    ActionItem actionItem = quickAction.getActionItem(pos);

    if (actionId == 0) {
    actionItem.setTitle(“New title”);
    }
    etc…

    I miss something?

    Thank you again.

    Reply
    • Vanqe says

      November 29, 2012 at 4:46 pm

      Well finally I rebuild all QuickAction & QuickItems and works good. But I dont understand what does setTitle, setActionId, etc if dont change anythng.

      Thank you.

      Reply
      • samolo says

        February 25, 2014 at 2:54 am

        Hi,

        Please show me, how you process?

        Reply
  174. Shachi says

    February 11, 2013 at 2:23 pm

    Hi,can u plz tell me where to post this code… I mean where shud I keep this code in library??
    I get an error when I write ActionItem in Java file.

    Thanks.

    Reply
    • rer says

      May 15, 2013 at 5:03 pm

      to marav

      Reply
  175. Satyr Frost says

    February 24, 2013 at 7:15 am

    Thanks very much.

    Reply
  176. PinoyGeekster says

    February 26, 2013 at 3:21 pm

    Hi Thank you for this helpful post.
    I am new to Android dev and I want to use your implementation on my current Android app project.

    I am using Mono for Android, VS2010 plugin. I just want to ask how can I incorporate or reference your implementation on my project

    Thank you very much!

    Reply
  177. Evan says

    April 12, 2013 at 1:21 pm

    Thanks for the awesome tool. I tried to use it, but it seems to pop up covering my button, rather than popping up from it, like your examples…any ideas?

    Reply
    • Evan says

      April 13, 2013 at 8:42 am

      nevermind, my button was in a different layout, once i moved the buttons out it worked.

      Reply
  178. Digetix says

    May 14, 2013 at 7:01 pm

    Thank you, that’s fine. But I have a question. How to display the menu

    mQuickAction.show(v);

    to do when the user clicks the physical menu button?

    Reply
    • Evan says

      May 28, 2013 at 4:21 am

      replace view1 with the name of the buttons view you want the QA to popup from.

      Perhaps you should learn android a little better, as capturing hardware button presses is a fundamental task in android.

      @Override
      public boolean onKeyDown(int keycode, KeyEvent e) {
      switch (keycode) {
      case KeyEvent.KEYCODE_MENU:
      View v = (View) findViewById(R.id.view1);
      mQuickAction.show(v);
      btnSocialMenu.performClick();
      return true;
      }

      return super.onKeyDown(keycode, e);
      }

      Reply
      • Evan says

        May 28, 2013 at 4:22 am

        remove the “btnsocialmenu…” code, I have my menu key doing something else in my app besides triggering the QA menu.

        Reply
  179. Raul says

    May 28, 2013 at 1:19 am

    Hi there! Finally I succeed and make the QuickAction work for my app. Now I am thinking if I can manage to make the slider or the icons to be in the center of the QucikAction Slider. Is there any way solving this? 😀

    Thanx

    Reply
  180. Cris says

    July 1, 2013 at 5:43 am

    For those that did make this work for your App how did you do it? Did you export a .jar file? if so what did you include in the .jar? did you import a class folder? if so which folder(s) ? I ran into NoClassDefFoundError at first (see above) and other problems later once I got the .jar in, but… how do I know if I am importing this code “the correct way” ? what is the correct way?

    Reply
  181. Premkumar says

    August 6, 2013 at 8:25 pm

    Hi all,

    we have using mQuickAction.addActionItem(upAction); code for add item.

    similarly what code we have to use for remove item?

    Reply
    • mayank says

      January 17, 2014 at 8:05 pm

      hi, friend my name is mayank langalia
      i’m android app. developer
      i want to create like below gridview type menu have you any sample code ?

      if yes then please send us …
      need your help for creating like below image.

      http://www.edumobile.org/android/wp-content/uploads/2011/09/quick_action_grid.png

      Reply
  182. Souvik says

    September 3, 2013 at 7:39 pm

    Nice utility you have give here. Can u plz tell me how to change the backgroung of the floating menu, which is currently Black. thanks in advance.

    Reply
  183. Praveen says

    December 3, 2013 at 3:53 pm

    Hi, really nice blog, Thank you for your effort to implement this feature control to fancy the old fashioned spinner view.

    Reply
    • mayank says

      January 17, 2014 at 8:06 pm

      hi, friend my name is mayank langalia
      i’m android app. developer
      i want to create like below gridview type menu have you any sample code ?if yes then please send us …
      need your help for creating like below image. http://www.edumobile.org/android/wp-content/uploads/2011/09/quick_action_grid.png

      Reply
  184. Krishna says

    December 12, 2013 at 3:28 pm

    Very Usefull Blog … it worked me perfect but i am trying to get different images on different options. I used this code but it taking only one images as selected but i need to differ. i did like this if (actionId == ID_DATE_TO_REMEMBER) {
    dateToRemember.setIcon(getResources().getDrawable(R.drawable.datestoremember_active));
    Toast.makeText(getApplicationContext(), “Let’s do some search action”, Toast.LENGTH_SHORT).show();
    }

    but it is not working… can you suggest me how to solve ???? Thanks in Advance

    Reply
  185. Michael Chourdakis says

    December 27, 2013 at 7:13 pm

    It’s nice, but can it also scroll down when no space is available?

    M.

    Reply
  186. Vikalp Patel says

    January 6, 2014 at 5:11 pm

    Kudos!!

    Fantastic Job!

    Thanks!

    Reply
  187. samolo says

    March 2, 2014 at 12:06 am

    Hi,

    I am attempting to change the title on an action item after I have created the action item. It doesn’t seem to be updating. I am using the following code:

    quickAction.getActionItem(2).setTitle(“Remove Star”);

    Reply
  188. Jagdish says

    April 4, 2014 at 7:31 pm

    Really nice work. Very help tutorial. Many thanks! Keep it up. 🙂

    Reply
  189. M4SH says

    April 17, 2014 at 12:07 am

    I am trying to integrate this library with ActionBarSherlock. However, quick action menu is not displayed on clicking the action bar item. Any suggestions?

    Reply
  190. Kaustav Ghosh says

    May 14, 2014 at 2:54 pm

    Is there anyway to customize the menu layout??

    Reply
  191. Kaustav Ghosh says

    May 14, 2014 at 2:55 pm

    Is there any way to customize the menu layout??

    Reply
  192. Decoder says

    July 9, 2014 at 8:45 pm

    Thanks

    Reply
  193. Yasser says

    December 29, 2014 at 4:40 pm

    Hi

    Thanks for your great effort ….

    When I replace this toast on onItemClick(QuickAction quickAction, int pos, int actionId)

    if (actionId == ID_ADD) { //Add item selected
    Toast.makeText(ContextApp.getAppContext(), “Add item selected on row ” + mSelectedRow, Toast.LENGTH_SHORT).show();
    } else {
    Toast.makeText(ContextApp.getAppContext(), actionItem.getTitle() + ” item selected on row ”
    + mSelectedRow, Toast.LENGTH_SHORT).show();
    }

    by this piece of code to jump to intent

    Intent i = new Intent(getActivity(), DoctorVisit.class);
    startActivity(i);

    It gives an error

    Reply
  194. Mukund says

    October 8, 2017 at 9:42 pm

    I am new to Android Development but I want to set quick action dialog to gridview item click but I can’t.. Can you please help me to pass the view to show the dialog.

    Reply
  195. Mukund says

    October 8, 2017 at 9:45 pm

    Can i set to a gridview item? please describe

    Reply
  196. Mukund says

    October 8, 2017 at 9:51 pm

    I am trying to set with a gridview item click but I am unable to pass the view (gridview item) to show which require as quickaction.show(view);

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

About Me

A husband, father of two, passionate software developer, diy lover and home baker who loves to learn new things. Read More…

  • Facebook
  • GitHub
  • Google+
  • Instagram
  • Twitter
  • YouTube

Featured Articles

How to Setup MQTT Server Using Mosquitto and Libwebsocket on Freebsd

Blue Bamboo P25 Printer Android Demo Application With Source Code

Simple JSON RPC Client for Android

How to Send Message to Google Cloud Messaging (GCM) Server Using JSON and PHP

Footer

Recent Comments

  • Aditya Dabas on About
  • Ayten Göksenin Barutçu on How to Make Android Map Scrollable Inside a ScrollView Layout
  • mang jojot on About
  • Hussain on How to Programmatically Scan or Discover Android Bluetooth Devices

Recent Posts

  • How to Fix Blank Screen on WordPress Add/Edit Post Page
  • How to Programmatically Restart the ESP32 Board
  • How to Get Hardware Info of ESP32
  • How to Setup MQTT Server Using Mosquitto and Libwebsocket on Freebsd

Latest Tweets

To protect our users from spam and other malicious activity, this account is temporarily locked. Please log in to https://twitter.com to unlock your account.

Copyright © 2023 · Magazine Pro on Genesis Framework · WordPress · Log in