Finally I solved it this way:
if (this.getWindowManager().getDefaultDisplay().getOrientation() == 0 ||
this.getWindowManager().getDefaultDisplay().getOrientation() == 2) {
Log.e("TAG","LANDSCAPE");
}else{
Log.e("TAG","PORTRAIT");
}
VALUES FOR: getWindowManager().getDefaultDisplay().getOrientation()
0 AND 2: LANDSCAPE 1 AND 3: PORTRAIT
With this condition in the onCreate() method we can determine the orientation in which the appliance resides.