默认情况下,android 创建新项目为 ActionBarActivity [英] By default android creating new project as ActionBarActivity

查看:24
本文介绍了默认情况下,android 创建新项目为 ActionBarActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了eclipse,SDK和我的问题是

I recently updated eclipse, SDK and my problems are

  1. 默认采用 fragment_main.xml
  2. 将默认活动扩展到 ActionBarActivity
  3. 默认添加库 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.

  1. 将您的 SDK 降级到 4.3 或更低版本.
  2. 删除 ActionBarActivity 并在您的 java 文件中扩展 Activity.

两者都适合你.

这篇关于默认情况下,android 创建新项目为 ActionBarActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆