什么是 Android Studio 中的向后兼容性? [英] What is Backwards Compatibility in Android Studio?

查看:35
本文介绍了什么是 Android Studio 中的向后兼容性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Android 开发的新手.即使我提到了 android 开发者

一般来说,Android 开发者更喜欢什么?启用向后兼容或不兼容?谁能给我解释一下哪个更好.

解决方案

Android 应用程序可以向后兼容,无需选中此复选框.

<块引用>

如果为 false,则此活动基类将是 Activity 而不是 AppCompatActivity

Android studio 通知您,如果您取消选中向后兼容性(Appcompat)"框,那么您将包含 &使用库 Activity 而不是 AppCompatActivity.有关两者之间更详细的比较,请查看:Activity、AppCompatActivity、FragmentActivity 和 ActionBarActivity:何时使用哪个?

<块引用>

一般来说,Android 开发者更喜欢什么?启用向后兼容或不兼容?

CommonsWare"撰写的评论对此进行了最好的解释:

在选中该复选框的情况下创建的活动与未选中该复选框的活动相比,不会向后兼容.选中该复选框可为您的应用提供特定的外观和感觉,从而在某些较旧的设备上保留该外观;不选中该复选框意味着您的外观和感觉的某些方面在 Android 5.0 之前的设备上会有所不同.不过,这不会影响活动的核心功能.– CommonsWare

I'm a newbie to Android Development. Even though I referred the android developer website, I didn't figure out.

On the customize Activity dialog box, when I unchecked the Backwards Compatiblity(Appcompat) in Android Studio 2.3.1 It gave me a hint as:

If false, this activity base class will be Activity instead of AppCompatActivity

Generally, what do android developers prefer? enabling backwards compatibility or without it? Can anyone explain me which one is better.

解决方案

Android apps can be backward-compatible without checking this checkbox.

If false, this activity base class will be Activity instead of AppCompatActivity

Android studio is letting you know that if you uncheck the "Backwards Compatability(Appcompat)" box, then you'll be including & using the library Activity instead of AppCompatActivity. For a more detailed comparison between the two, check this: Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?

Generally, what do android developers prefer? enabling backwards compatibility or without it?

A comment written by "CommonsWare" explains this best:

An activity created with that checkbox checked is no more backwards compatible than is one without that checkbox checked. Checking the checkbox gives your app a particular look and feel that will retain that look and feel on some older devices; leaving the checkbox unchecked means that some aspects of your look and feel will be different on pre-Android 5.0 devices. This does not impact the core functionality of the activity, though. – CommonsWare

这篇关于什么是 Android Studio 中的向后兼容性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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