默认情况下,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.
两者都适合你.
相关文章