且构网

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

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

更新时间:2023-09-17 17:46:16

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

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

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

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

Android Studio会让您知道,如果您取消选中向后兼容性(Appcompat)"框,则将包含&使用库Activity而不是AppCompatActivity. 要对两者进行更详细的比较,请检查以下内容: Activity,AppCompatActivity, FragmentActivity和ActionBarActivity:何时使用哪个?

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?

通常,Android开发人员更喜欢什么?是向后兼容还是没有向后兼容?

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

"CommonsWare"撰写的评论***地解释了这一点:

A comment written by "CommonsWare" explains this best:

与未选中该复选框的活动相比,向后兼容的活动不具有向后兼容性.选中该复选框可为您的应用提供特定的外观,并在某些较旧的设备上保留该外观;如果未选中此复选框,则表示您的外观在某些方面与Android 5.0之前的设备有所不同.但是,这不会影响活动的核心功能. – CommonsWare

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