LuckSiege / LuckSiege/PictureSelector
android.util.AndroidRuntimeException: requestFeature() must be called before adding content
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 13.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Current use version?
#### 当前使用的版本是多少?
v3.10.6
## Will this problem occur in demo?
#### Demo能否复现这问题?
false
## Describe the problem or provide an error log?
#### 描述问题或提供错误log?
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at com.android.internal.policy.PhoneWindow.requestFeature(PhoneWindow.java:392)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at com.luck.picture.lib.immersive.ImmersiveManager.immersiveAboveAPI23(ImmersiveManager.java:72)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at com.luck.picture.lib.immersive.ImmersiveManager.immersiveAboveAPI23(ImmersiveManager.java:35)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at com.luck.picture.lib.basic.PictureSelectorSupporterActivity.immersive(PictureSelectorSupporterActivity.java:49)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at com.luck.picture.lib.basic.PictureSelectorSupporterActivity.onCreate(PictureSelectorSupporterActivity.java:33)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.Activity.performCreate(Activity.java:8143)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.Activity.performCreate(Activity.java:8114)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3513)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3700)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.os.Looper.loop(Looper.java:236)
2022-08-27 21:25:33.377 1959-1959/com.dream.music_depot W/System.err: at android.app.ActivityThread.main(ActivityThread.java:8060)
2022-08-27 21:25:33.378 1959-1959/com.dream.music_depot W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2022-08-27 21:25:33.378 1959-1959/com.dream.music_depot W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
2022-08-27 21:25:33.378 1959-1959/com.dream.music_depot W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
这是我运行项目时,自动同步的版本号。
+--- androidx.fragment:fragment:1.3.1 -> 1.5.0 (*)
当我降低Fragment的版本号为1.3.6时,正常展示了。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with com.luck.picture.lib.immersive.ImmersiveManager.java at line 72 and trace its call from PictureSelectorSupporterActivity.java lines 33 and 49. Compare the behavior with androidx.fragment versions 1.3.6 and 1.5.0, then verify that the reported AndroidRuntimeException no longer occurs and the selector still displays correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100