android – QuickActions like the Twitter app-ThrowExceptions

Exception or error:

I want to add Pattern 6: QuickActions from android’s blog to my app.

Any code snippet?

Anyone try to do it already?

Should this work on android 1.5?

How to solve:

That app is going to be open sourced at some point so you may want to wait until then. But it could be done with a Dialog with a custom background drawable, and using Window.LayoutParams to position the dialog.

###

I just found this question right after I posted my own question/answer. Here’s the code I developed for this. http://code.google.com/p/simple-quickactions/

###

I also have been searching for this and found someone through the wave of the Google IO session who has implemented such thing.

He posted the code on GitHub. I just tested it, and it works just great!

You’ll also need some ressources from the project (drawables, styles..).

###

Look at line 1310 of ContactsListActivity.java from the Contacts application. It’s the code that creates the intent for the contact shortcuts on the home screen that launch the quick actions intent for a contact.

This won’t work before eclair.

###

Until the official Twitter app is open sourced by Google, you may want to take a look at this implementation:

It’s really easy to use and works great.

Leave a Reply

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