diff --git a/picture_library/src/main/java/com/luck/picture/lib/PictureBaseActivity.java b/picture_library/src/main/java/com/luck/picture/lib/PictureBaseActivity.java index a49668212..2cdd92c9d 100644 --- a/picture_library/src/main/java/com/luck/picture/lib/PictureBaseActivity.java +++ b/picture_library/src/main/java/com/luck/picture/lib/PictureBaseActivity.java @@ -51,7 +51,7 @@ * @data:2018/3/28 下午1:00 * @描述: Activity基类 */ -public class PictureBaseActivity extends FragmentActivity implements LifecycleOwner { +public class PictureBaseActivity extends FragmentActivity { protected Context mContext; protected PictureSelectionConfig config; protected boolean openWhiteStatusBar, numComplete; @@ -61,7 +61,6 @@ public class PictureBaseActivity extends FragmentActivity implements LifecycleOw protected PictureDialog dialog; protected PictureDialog compressDialog; protected List selectionMedias; - private LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this); /** * 是否使用沉浸式,子类复写该方法来确定是否采用沉浸式 * @@ -84,12 +83,11 @@ public void immersive() { @Override public Lifecycle getLifecycle() { - return mLifecycleRegistry; + return super.getLifecycle(); } @Override protected void onCreate(Bundle savedInstanceState) { - mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE); if (savedInstanceState != null) { config = savedInstanceState.getParcelable(PictureConfig.EXTRA_CONFIG); cameraPath = savedInstanceState.getString(PictureConfig.BUNDLE_CAMERA_PATH); @@ -134,7 +132,6 @@ private void initConfig() { @Override protected void onSaveInstanceState(Bundle outState) { - mLifecycleRegistry.markState(Lifecycle.State.CREATED); super.onSaveInstanceState(outState); outState.putString(PictureConfig.BUNDLE_CAMERA_PATH, cameraPath); outState.putString(PictureConfig.BUNDLE_ORIGINAL_PATH, originalPath); @@ -465,7 +462,6 @@ protected void closeActivity() { @Override protected void onDestroy() { - mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY); super.onDestroy(); dismissCompressDialog(); dismissDialog(); @@ -575,28 +571,4 @@ protected String getAudioFilePathFromUri(Uri uri) { } return path; } - - @Override - protected void onStart() { - mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START); - super.onStart(); - } - - @Override - protected void onStop() { - mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_STOP); - super.onStop(); - } - - @Override - protected void onResume() { - mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME); - super.onResume(); - } - - @Override - protected void onPause() { - mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE); - super.onPause(); - } }