Using ActionBarSherlock With the New SupportMapFragment

前端 未结 6 482
闹比i
闹比i 2020-11-28 03:30

I am looking at using ActionbarSherlock but have one query that\'s holding me back.

So my application needs to be fully backwards compatible to API Level 7.

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 04:07

    I heard that Jake is not going to do too much more to ABS as Google may be bringing out their own backward compatible ActionBar. I think if I remember correctly it was discussed in one of the Android related Google+ hangouts.

    The new maps requires API level 8 onward so before even worrying about the actionbar you will run into problems if you must support API level 7.

    My advice would be produce 2 layout files one for level 7 and and one for 8+. In the level 7 use the now old MapView although they are deprecating it, which for me shows how API level 7 is not necessarily worth considering as a target. In the 8+ layout use the new map system.

    As for the actionbar, we are porting an app right now and have easily and successfully added a map to a ViewPager, by creating the Fragment programtically (rather than in XML). We have tested it on multiple devices.

    We have also had no issues using the new map system as described in Google demos with ABS. We declared the fragment in an XML layout and set this as the content of the activity. The ActionBar displays as normal. The Activity is a SherlockFragmentActivity.

提交回复
热议问题