oncreate() mwthod
if(this.getResources().getConfiguration().orientation ==Configuration.ORIENTATION_PORTRAIT)
{
// do code here to arrange the layout as for portrait mode
}
else
{
// do code here to arrange the layout as for Landscape mode
}
, accrodingly