最佳答案
您至少需要 22.1 版的支持库。 鉴于 ActionBarActivity 适合您,但 AppCompatActivity 不适合您,您可能拥有没有 AppCompatActivity 的旧版本支持库。
来自here :
The major revision for v22.1 is the deprecation of ActionBarActivity. It initially served as a convenient way to bring the ActionBar to the Android 2.1 and above, and would act as a compatibility layer for any version of Android that already included it (starting with Android 3.0 Honeycomb). Taking its place will be AppCompatActivity. On the surface, the new class will offer all of the same functionality, but it's built on top of a new AppCompatDelegate that can be used to enable most of the same features without requiring developers to inherit from AppCompatActivity. This re-engineering effort is also serving as the base for a new AlertDialog class, so every part of the user interface can benefit from the extensive list of theming features that were demonstrated for Lollipop.
转到您的 SDK 管理器查看您安装的支持库版本:
如果您的版本低于 22.1,请下载最新版本,然后用新版本替换项目中的 jar 文件。
关于java - 在 Android 中使用 AppCompatActivity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33678719/