actionbar with this library

692 views
Skip to first unread message

patjackson52

unread,
Jan 9, 2012, 3:43:45 PM1/9/12
to Android Compatibility Library for Google Maps - Support
Hello,
I used this hack by creating my own library from the compatability
library before I found your library. The mapviews have worked fine
for me, however I have not been able to get the actionbar api to work
for some reason. Whenever I use getActionBar() it returns null. Has
anyone tried this with this library??

Pete Doyle

unread,
Jan 9, 2012, 3:47:52 PM1/9/12
to android-support-v4...@googlegroups.com
Are you trying on a Honeycomb (or higher) device?

If so, you might check this out:
"Tip: If you have a custom activity theme in which you'd like to remove the action bar, set the android:windowActionBar style property to false. However, if you remove the action bar using a theme, then the window will not allow the action bar at all, so you cannot add it later—calling getActionBar() will return null."

Thanks,
Pete

Patrick Jackson

unread,
Jan 9, 2012, 3:52:26 PM1/9/12
to android-support-v4...@googlegroups.com
Yes I am.  Actually using on phones and honeycomb.  I have checked that as well.  So you have used this library with the actionbar?  reason I ask is I have tried this with code that worked with the actionbar before adding the maps lib.

thanks!

Pete Doyle

unread,
Jan 9, 2012, 4:13:43 PM1/9/12
to android-support-v4...@googlegroups.com
Hi Patrick,
To be honest, I've actually been using ActionBarSherlock + Maps plugin (http://abs.io) so I don't have to implement my own action bar pre-3.0.

I'm not sure off the top of my head why getActionBar() might be returning null.  I know you've checked the theme, but it might be worth just triple-checking since that's all I can find on Google.

Here's another mention about needing the correct theme:
Caution: If your activity does not have an Action Bar (if you did not set the theme of your activity or application to the holographic or Action Bar theme), then getActionBar() returns null.

Even though I'm using ActionBarSherlock, it delegates to the native ActionBar implementation (the same as this library does).  Here's the relevant theme I'm using which works on the emulator on Honeycomb+:  https://gist.github.com/1584943

Patrick Jackson

unread,
Jan 9, 2012, 4:18:08 PM1/9/12
to android-support-v4...@googlegroups.com

Ok.  Thanks for the detailed reply.  I will be looking into this to see what the issue is.  It sounds like it is on my side somewhere.  The fact that you are using the actionbar(through sherlock) gives me hope. 

Thanks again,
Patrick

Patrick Jackson

unread,
Jan 10, 2012, 10:14:21 AM1/10/12
to android-support-v4...@googlegroups.com
FYI, I've got the actionbar working.  It was an issue with my theme - I just added  parent="android:style/Theme.Holo".  I think in version 11 of the sdk this was not required because I took that code from the google IO app that used the actionbar.  Anyway, thanks for helping out a random guy and let me know if I can return the favor anytime.  I'm knowlegable on android and GWT.
  
Patrick Jackson

Pete Doyle

unread,
Jan 12, 2012, 4:53:36 PM1/12/12
to android-support-v4...@googlegroups.com
Happy to help :) I'm glad that's all it was.  Thanks for the offer, I might take you up on it some day!
Pete
Reply all
Reply to author
Forward
0 new messages