AppCompatActivity和Activity的区别

2020-03-12  本文已影响0人  Lady_Lee

所属的包不同:
implementation 'androidx.appcompat:appcompat:1.0.2'
appcompat-1.1.0-alpha01-sources.jar/androidx/appcompat/app/AppCompatActivity.java
class AppCompatActivity extends FragmentActivity
class FragmentActivity extends ComponentActivity
class ComponentActivity extends androidx.core.app.ComponentActivity implements
LifecycleOwner,
ViewModelStoreOwner
class ComponentActivity extends Activity

implementation 'com.android.support:appcompat-v7:28.0.0'
android/support/v7/app/AppCompatActivity.java
class AppCompatActivity extends FragmentActivity
class FragmentActivity extends SupportActivity implements ViewModelStoreOwner
class SupportActivity extends Activity implements LifecycleOwner

targetSdkVersion 28
implementation 'com.android.support:support-v4:28.0.0'
android-28/android/app/Activity.java

上一篇 下一篇

猜你喜欢

热点阅读