Hello,
I was making an extension
Java code :
import android.app.Activity;
import android.os.Build;
import android.view.WindowManager;
@SimpleFunction(description = "")
public void ShowInCutout() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
activity.getWindow().getAttributes().layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
}
But when i was making the test, the first click didn’t trigger the code meaning it didn’t work but the second try was working. So i needed to make it once, how can i trigger it once only, not twice?
To test the apk test by yourself :
- Open the app
- Landscape your phone
- Start click on the button until something changed, thats it
- If you saw my problem, please just fix it
Thank you.