默认情况下,android 创建新项目为 ActionBarActivit

By default android creating new project as ActionBarActivity(默认情况下,android 创建新项目为 ActionBarActivity)
本文介绍了默认情况下,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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

VertX 3.9.7 when i receive the form quot;throw exceptionquot; Size exceed allowed maximum capacityquot;(VertX 3.9.7收到表单时抛出异常SIZE超出允许的最大容量QUOT;)
Android This feature requires ASM7(Android此功能需要ASM7)
JDK11 Upgrade Fails - ClassNotFoundException jdk.internal.ref.Cleaner(JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleaner)
How to make Eclipse compile patched modules on JDK 9+ by passing the --patch-module javac option to my project compiler? (see pic)(如何通过向我的项目编译器传递--patch-MODULE javac选项,让Eclipse在JDK 9+上编译打了补丁的模块?(见图))
JavaFX Modular Application, java.lang.module.FindException: Module javafx.controls not found (Java 11, Intellij)(JavaFX模块化应用程序,java.lang.mode.FindException:未找到模块javafx.Controls(Java 11,IntelliJ))
Cannot resolve symbol Theme.MaterialComponents.Light.NoActionBar (Android Studio)(无法解析符号Theme.MaterialComponents.Light.NoActionBar(Android Studio))