diff --git a/app/src/main/java/com/github/jeffery/skin/MainActivity.java b/app/src/main/java/com/github/jeffery/skin/MainActivity.java
index 54f89a3..c556e45 100644
--- a/app/src/main/java/com/github/jeffery/skin/MainActivity.java
+++ b/app/src/main/java/com/github/jeffery/skin/MainActivity.java
@@ -1,15 +1,14 @@
package com.github.jeffery.skin;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.core.app.ActivityCompat;
-
import android.Manifest;
+import android.content.Intent;
import android.os.Bundle;
-import android.view.View;
import android.widget.TextView;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+
import java.io.File;
-import java.io.IOException;
public class MainActivity extends AppCompatActivity {
@@ -35,6 +34,7 @@ protected void onCreate(Bundle savedInstanceState) {
SkinManger.getInstance().setAppSkin(file12.getAbsolutePath());
tvSkinName.setText(getCurrentSkinName());
});
+ findViewById(R.id.btn_fragment).setOnClickListener(v -> startActivity(new Intent(v.getContext(), SecondActivity.class)));
ActivityCompat.requestPermissions(this, new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
diff --git a/app/src/main/java/com/github/jeffery/skin/TestFragment.java b/app/src/main/java/com/github/jeffery/skin/TestFragment.java
new file mode 100644
index 0000000..3316d64
--- /dev/null
+++ b/app/src/main/java/com/github/jeffery/skin/TestFragment.java
@@ -0,0 +1,23 @@
+package com.github.jeffery.skin;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+/**
+ * @author mxlei
+ * @date 2022/8/31
+ */
+public class TestFragment extends Fragment {
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_test, container, false);
+ }
+}
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 285aa8d..59e39d4 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,6 +1,5 @@
+
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_test.xml b/app/src/main/res/layout/fragment_test.xml
new file mode 100644
index 0000000..e84b758
--- /dev/null
+++ b/app/src/main/res/layout/fragment_test.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/skin-changer/src/main/java/com/github/jeffery/skin/SkinManger.java b/skin-changer/src/main/java/com/github/jeffery/skin/SkinManger.java
index 75d05a5..dfe2404 100644
--- a/skin-changer/src/main/java/com/github/jeffery/skin/SkinManger.java
+++ b/skin-changer/src/main/java/com/github/jeffery/skin/SkinManger.java
@@ -327,13 +327,6 @@ public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle saved
activityStack.push(skinActivityRecord);
}
- @Override
- public void onActivityPostCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
- super.onActivityPostCreated(activity, savedInstanceState);
- // 应用皮肤到本界面
- reloadSkin(getActivityRecord(activity));
- }
-
@Override
public void onActivityResumed(@NonNull Activity activity) {
super.onActivityResumed(activity);