Issue
I am attempting to add the same action bar compatibility found in the Google "ActionBarCompat" sample code to one of my projects.
My problem is that I already extend MapActivity
in my main class, but the main class of ActionBarCompat seems to require that you extend ActionBarActivity
.
Here's my Java 101 question: I know enough about Java to know that I can't have multiple inheritance, but not enough to know the ideal way to handle this situation. My solution was to extend ActionBarActivity in my main class, but then make ActionBarActivity
extend MapActivity
. Is this the correct way to do this? If so, wouldn't I have to make a duplicate ActionBarActivity
if I want it to extend other things?
Thanks for your consideration of this question!
Solution
Yes, that's a totally valid way of doing this. If you want an ActionBarActivity class that doesn't extend the MapActivity, you'll have to create another class. I don't think this will lead to a lot of code-duplication (which I'm guessing is what you're afraid of). Shame on the android developers though for making you need to code your own ActionBarHelper class.
Answered By - Kurtis Nusbaum
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.