Created
April 11, 2020 10:05
-
-
Save AbreuY/de15d77d6d2e2330d3dd7516dd52ec69 to your computer and use it in GitHub Desktop.
[Solución] Android 8.0 Only fullscreen opaque activities can request orientation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressLint("SourceLockedOrientationActivity") | |
public static void chequeaVersion(Activity activity){ | |
//Verifica si es diferente de android O | |
if (android.os.Build.VERSION.SDK_INT != Build.VERSION_CODES.O){ | |
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); | |
Log.d("TAG", "No es android O"); | |
}else{ | |
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); | |
Log.d("TAG", "Es android O"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment