Hello there, Gem2x! If your Galaxy phone or tablet won't stop rotating its screen, or, on the other hand, if it does not rotate at all, don't panic. Your device comes with screen rotation settings built right in. It's just a matter of making sure you have the correct settings in place. You can make your device's screen rotate freely with Auto rotate, or lock it in one position using either Portrait or Landscape mode.
You may check out this link; https://www.samsung.com/us/support/answer/ANS00088202/
Hope to have helped you. Be sure to click " ✓ Accept as Solution" when you find an answer that works for you. Stay safe and have a nice day ahead!
It is still happening now even on the UI 4.1 update. Also even if the orientation is locked. It still rotates specially when you are shaking it while playing MLBB.