Hi guys,

I like the user experience for sharing provided by 
ShareCompat.configureMenuItem.  Instead of a basic chooser, it embeds 
drop-down sharing selection right in my app's action bar.  It even 
remembers the most recently used share target and adds a button for it to 
my actionbar, so, frequently, sharing from my app is a single click.  Cool!

However, when instrumenting my app for google analytics, I hit a snag.  I 
cannot find any way to hook into the events of these generated menu items. 
 :(

I'm using ShareCompat.configureMenuItem this way:
ShareCompat.configureMenuItem(menu, R.id.menu_share, shareIntentBuilder);
...and the sharing functionality totally works. :)  I just can't find a way 
to hook into this user interaction for tracking purposes.

I tried listening for sharing events in onOptionsItemSelected.
 - It is never called when clicking on the generated share buttons in the 
action bar.
I tried adding my own explicit click listener to the menu item I'm passing 
to configureMenuItem.
 - It is never called when clicking on the generated share buttons in the 
action bar.
I tried adding a click listener to the action view for the menu_share 
button.
 - It is never called...
I have access to the Intent, but could not find a way to know when my share 
Intent is invoked.
I have access to the ActionBar, but could not find a way to generically 
listen for clicks to any menu items that might be generated on the bar for 
my app.

For now, I'm stuck using the old-style chooser for sharing, just so I can 
actually track this user activity in google analytics.  I would very much 
like to know if the sharing feature is useful, and for which activities 
this feature is most popular, to guide the evolution of my app.  But I also 
want to provide users with the shiny new actionbar sharing approach, when 
available through ShareCompat.

Any thoughts or advice?

Thank you,
Chris

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to