ActionBarCompat和MapActivity

ActionBarCompat和MapActivity

本文介绍了ActionBarCompat和MapActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地转换了我的大部分应用程序使用的 ActionBarCompat 按大多数活动延长ActionBarActivity,但是...我有一个 MapActivity 类需要这个工作在这里。

I've successfully converted most of my app to use ActionBarCompat by extending ActionBarActivity on most activities, however... I have a MapActivity class and need this to work here as well.

我将如何着手创建基于ActionBarActivity一个新的类,并让它延长MapActivity并会甚至工作?

How would I go about creating a new class based on ActionBarActivity and having it extend MapActivity and would that even work?

这是谷歌在../samples/android-17/ActionBarCompat目录提供样品有很多这样的Java文件(ActionBarActivity.java等),而且还需要布局,风格,图形等等万吨,等等,我不知道,如果将所有这些文件到我的项目是让这个地图画面工作的唯一途径。好像必须有一个更好的办法吧?

The sample that Google provides in the ../samples/android-17/ActionBarCompat directory has a lot of these java files (ActionBarActivity.java, etc.) but also tons of required layouts, styles, drawables, etc., etc. and I wasn't sure if adding all of those files to my project is the only way to get this one map screen to work. Seems like there has to be a better way right?

推荐答案

您不能创建来自继承的活动。你必须创建一个 MapFragment 。

You can't create an activity that inherits from both. You'll have to create a MapFragment.

这篇关于ActionBarCompat和MapActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:41