This phone: http://www.samsung.com/hk_en/consumer/mobile/mobile-phones/smartphone/GT-S5300ZKATGY-features
Does it definitely have a sensor to know its been changed in orientation? In your settings is auto-rotate switched off?
I can't see any issue in what you've posted that I know would stop orientation changes working.