Android Question Problem: Only fullscreen opaque activities can request orientation

vecino

Well-Known Member
Licensed User
Longtime User
Hi, if I compile with SDK 26 it works fine, but with 28 it doesn't work anymore. I have changed opaque and transparent colors, I have changed fullscreen yes and no.
What is the solution to this problem?
Thank you.


** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
No partial wakelock.
** Activity (main) Pause, UserClosed = false **
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.newtron.comanda/com.newtron.comanda.acpreferencias}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2824)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2899)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1600)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6590)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
at android.app.Activity.onCreate(Activity.java:986)
at com.newtron.comanda.acpreferencias.onCreate(acpreferencias.java:34)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2777)
... 9 more
 

vecino

Well-Known Member
Licensed User
Longtime User
Hello, there is nothing special about the activity, only "Title=False".
I have tried an opaque color, a transparent color, a semi-transparent color.
But it only works if SDK=26 in the manifest.
Thank you.

nada.png
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
But, however, when the #SupportedOrientations: unspecified it works well.
But does not work when #SupportedOrientations: portrait
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
I cannot reproduce it in another project, it only happens with this project.
I don't know if I should create a new project and copy all the code and layouts, to see if there is a hidden problem.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hello, I have found the cause of the problem.
Now I would like to find the solution.
I have a couple of activities that occupy only a central part of the screen, so the rest is transparent to be seen behind the main screen.
What alternative can I use?
Thank you.

B4X:
SetActivityAttribute(acDatosSMB,        android:theme, @android:style/Theme.Translucent.NoTitleBar)
SetActivityAttribute(acPreferencias,    android:theme, @android:style/Theme.Translucent.NoTitleBar)
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
With a B4XDialog?
I suppose it is possible to load a layout in it, is that it?
Thank you.
 
Upvote 0
Top