i know its a noob question but i am new in android development and i dont want my app rotate in landspace.
according to some of questions i found sensor portrait. i tried to add it in manifest but i dont know where.
if its not working is there any source code to disable rotate?
i am really need help my layout looks owful in landspace.
i dont know how to fix the background
what can i do to fix layout in landspace?
what should i do?
i didnt find the answer in question.
Take a look at this document, it explains each property in your AndroidManifest.xml. https://developer.android.com/guide/topics/manifest/activity-element.html
How to use sensorportrait?
These Properties are defined in your AndroidManifest.xml file.
android:screenOrientation=["unspecified" | "behind" | "landscape" | "portrait" | "reverseLandscape" | "reversePortrait" | "sensorLandscape" | "sensorPortrait" | "userLandscape" | "userPortrait" | "sensor" | "fullSensor" | "nosensor" | "user" | "fullUser" | "locked"]
source code for disable rotate?
In your AndroidManifest.xml file, where you define "activity", u set orientation you support as defined above.
fix layout in landspace?
You can have different layout for your activity in landscape mode. for this simply create
layout-landfolder parallel to
res. e.g. if you have
layoutfolder, create another
layout-landfolder. You can move stuff around as you wish. Note: I would reccomend you take a look at
Fragments, this might help you on what you are trying to achieve. https://developer.android.com/guide/components/fragments.html