Android

java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation

생각지도 못한 곳에서 에러가 터졌다. SDK 버전이 올라갈 때마다 개발자로써 거시기하다.

오류가 발생한 휴대폰은 화훼이.. 안드로이드 8.0.0버전이다.


 

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{ddol.Management/ddol.Management.ShowPowerOffActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
android.app.ActivityThread.performLaunchActivity + 3194 (ActivityThread.java:3194)
android.app.ActivityThread.handleLaunchActivity + 3302 (ActivityThread.java:3302)
android.app.ActivityThread.-wrap12 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage + 1891 (ActivityThread.java:1891)
android.os.Handler.dispatchMessage + 108 (Handler.java:108)
android.os.Looper.loop + 166 (Looper.java:166)
android.app.ActivityThread.main + 7425 (ActivityThread.java:7425)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.Zygote$MethodAndArgsCaller.run + 245 (Zygote.java:245)
com.android.internal.os.ZygoteInit.main + 921 (ZygoteInit.java:921)
Caused by java.lang.IllegalStateException
Only fullscreen opaque activities can request orientation
android.app.Activity.onCreate + 1081 (Activity.java:1081)
androidx.core.app.ComponentActivity.onCreate (ComponentActivity.java)
androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:6)
androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:42)

[AndroidManifest.xml]
<activity
   android:name=“ddol.Management.ShowPowerOffActivity”
   android:screenOrientation=“portrait”
   android:theme=“@style/Transparent” />

 

[해결법]
Orientation설정을 제거하거나  android:screenOrientation=”unspecified” 으로 설정을 변경하면 된다.
Transparent Activity의 경우 Orientation 설정에 주의해야함.


<activity
   android:name=“ddol.Management.ShowPowerOffActivity”
   android:screenOrientation=“portrait”
   android:theme=“@style/Transparent”/>

[들러보기]
IllegalStateException란 무엇인가?

Leave a Reply

error: Content is protected !!