Hi,
This question was asked before but can't remember where.. if you searched a little..
In general you need to compare the height and width of the activity.. if the height is bigger then it is in portrait.. (something like this).
Sorry misunderstanding.. I thought you are looking for getting the orientation, not setting it.