By default android creating new project as ActionBarActivity(默认情况下,android 创建新项目为 ActionBarActivity)
问题描述
我最近更新了eclipse,SDK和我的问题是
I recently updated eclipse, SDK and my problems are
- 默认采用
fragment_main.xml
- 将默认活动扩展到
ActionBarActivity
- 默认添加库
appcompat 7
我在添加库时没有任何问题,但是当我尝试运行时,它并没有在设备中执行(2.3 android).我注意到它并更改为 Activity.
I dont have any issues with adding the library, but when i am trying to run then it is not executing in the device(2.3 android). I noticed it and changed to Activity.
如果我将它扩展到 Activity 并再次运行它,下次在创建新的 Activity 时会出现同样的问题......
If i extends it to Activity and run it and again for the next time the same problem arises while creating new Activity like...
创建 2 个扩展 ActionBarActiity 的 xml 文件.
Creating 2 xml files with extending ActionBarActiity.
我只希望新类扩展 Activity
而不是 ActionBarActivity
我的目标设备是 2.3 及以上而不降级它
I just want the new class to extend Activity
but not ActionBarActivity
where my target device is 2.3 and above without downgrading it
推荐答案
SDK v4.4 自带.这对开发人员来说是一个加分项,因为开发人员不需要手动将 ActionBarActivity 添加到他们的项目中.您的问题有两种解决方案.
It comes in SDK v4.4 . It is a plus point for developers because developers don't need to manually add the ActionBarActivity into their project. There are two solutions for your problem.
- 将您的 SDK 降级到 4.3 或更低版本.或
- 删除 ActionBarActivity 并在您的 java 文件中扩展 Activity.
两者都适合你.
这篇关于默认情况下,android 创建新项目为 ActionBarActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:默认情况下,android 创建新项目为 ActionBarActivit


基础教程推荐
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 从 python 访问 JVM 2022-01-01