且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是 Android Studio 中的向后兼容性?

更新时间:2023-09-17 17:50:40

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