vecino Well-Known Member Licensed User Longtime User Nov 20, 2021 #1 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 Click to expand...
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 Click to expand...
vecino Well-Known Member Licensed User Longtime User Nov 20, 2021 #2 That's how it works. #SupportedOrientations: unspecified Click to expand... That's not how it works. #SupportedOrientations: portrait Click to expand... Upvote 0
That's how it works. #SupportedOrientations: unspecified Click to expand... That's not how it works. #SupportedOrientations: portrait Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2021 #3 You need to provide more information. Is this a transparent activity? Upvote 0
vecino Well-Known Member Licensed User Longtime User Nov 21, 2021 #4 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. Upvote 0
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.
vecino Well-Known Member Licensed User Longtime User Nov 21, 2021 #5 But, however, when the #SupportedOrientations: unspecified it works well. But does not work when #SupportedOrientations: portrait Upvote 0
But, however, when the #SupportedOrientations: unspecified it works well. But does not work when #SupportedOrientations: portrait
Erel B4X founder Staff member Licensed User Longtime User Nov 22, 2021 #6 Best if you reproduce it in a small project. Upvote 0
vecino Well-Known Member Licensed User Longtime User Nov 22, 2021 #7 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
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.
vecino Well-Known Member Licensed User Longtime User Nov 23, 2021 #8 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: Copy SetActivityAttribute(acDatosSMB, android:theme, @android:style/Theme.Translucent.NoTitleBar) SetActivityAttribute(acPreferencias, android:theme, @android:style/Theme.Translucent.NoTitleBar) Upvote 0
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: Copy SetActivityAttribute(acDatosSMB, android:theme, @android:style/Theme.Translucent.NoTitleBar) SetActivityAttribute(acPreferencias, android:theme, @android:style/Theme.Translucent.NoTitleBar)
Erel B4X founder Staff member Licensed User Longtime User Nov 23, 2021 #9 Use B4XDialog instead of a separate activity. Upvote 0
vecino Well-Known Member Licensed User Longtime User Nov 23, 2021 #10 With a B4XDialog? I suppose it is possible to load a layout in it, is that it? Thank you. Upvote 0