[Android Software/Hacking General [Developers Only]] idoom:
I was very confused, because in my code a lot of orientation variable , please check

this is the source code from jd-gui

public void onCreate(Bundle paramBundle)
{
Context localContext = getApplicationContext();
this.mPackageLoader = ((HomeApplication)getApplication()).getPackageLoader();
this.mInfoGroupManager = ((HomeApplication)getApplication()).getInfoGroupManager();
MyInstanceState localMyInstanceState = (MyInstanceState)getLastNonConfigurationInstance();
label91: boolean bool;
label222: Object localObject1;
if (localMyInstanceState != null)
{
this.mResourceLoader = localMyInstanceState.resourceLoader;
this.mAdapterHelper = localMyInstanceState.adapterHelper;
this.mStatistics = localMyInstanceState.statistics;
this.mLandscapeModeEnabled = true;
this.mThemeOptionEnabled = true;
if (this.mLandscapeModeEnabled)
break label990;
this.mDefaultOrientation = 1;
setRequestedOrientation(this.mDefaultOrientation);
this.mDeskStandListener = new DeskStandListener(null);
this.mStartupMap = new LinkedHashMap();
this.mStartupMap.put("Application", roundToNearest100(((HomeApplication)getApplication()).getApplicationCreateDuration()) + "");
this.mOnCreateStartTime = SystemClock.uptimeMillis();
super.onCreate(paramBundle);
setContentView((ViewGroup)LayoutInflater.from(this).inflate(2130903060, null));
getWindow().setSoftInputMode(3);
if (getResources().getConfiguration().orientation != 2)
break label1033;
bool = true;
this.mOrientationLandscape = bool;
this.mDisplayMetrics = getResources().getDisplayMetrics();
this.mFullScreenEffectPlaceholder = ((ViewGroup)findViewById(2131624002));
this.mFadeView = ((BackgroundFadeSrcXferView)findViewById(2131623998));
setWallpaperDimensions();
this.mTransferView = ((TransferView)findViewById(2131623997));
setupTransferView(this.mTransferView);
this.mSwitchButtonHideAnim = AnimationUtils.loadAnimation(this, 2130968638);
this.mSwitchButtonShowAnim = AnimationUtils.loadAnimation(this, 2130968639);
this.mNetworkNameManager = new NetworkNameManager((NetworkNameView)findViewById(2131624004));
this.mSwitchButtonHideAnim.setInterpolator(new DecelerateInterpolator());
setDefaultKeyMode(4);
this.mAppTrayButton = findViewById(2131623964);
this.mAppTrayButton.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
HomeActivity.this.hideDesktopAndOpenApptay(true);
}
});
this.mHomeButton = findViewById(2131623949);
this.mAppTrayButton.requestFocus();
this.mHomeButton.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
if (HomeActivity.this.mStageController != null)
HomeActivity.this.mStageController.sparkle();
HomeActivity.this.closeApptrayAndShowDesktop(true);
}
});
createActivityFlow();
this.mOnTouchModeChangeListener = new ViewTreeObserver.OnTouchModeChangeListener()
{
public void onTouchModeChanged(boolean paramBoolean)
{
if ((!paramBoolean) && (HomeActivity.this.mStealFocusNextModeChange))
HomeActivity.this.mTransferView.setDescendantFocusability(393216);
HomeActivity.access$402(HomeActivity.this, true);
}
};
this.mInfoGroupManager.setInfoListener(new InfoGroupManager.InfoListener()
{
public void onInfoRemoved(Info paramInfo)
{
HomeActivity.this.removeInfo(paramInfo);
}
});
this.mInfoGroupManager.bind(this, this.mResourceLoader);
this.mWidgetManager = new WidgetManager(localContext, AppWidgetManager.getInstance(localContext), new HomeAppWidgetHost(localContext, 171808569));
this.mAdvWidgetManager = new AdvWidgetManager(this, this.mAdvWidgetHost, this.mPackageLoader);
createDesktop();
if (localMyInstanceState == null)
break label1039;
localObject1 = localMyInstanceState.stageModel;
label518: createStage(localObject1);
createCornerButtons();
if (localMyInstanceState == null)
break label1045;
}
label1025: label1033: label1039: label1045: for (Object localObject2 = localMyInstanceState.apptrayModel; ; localObject2 = null)
{
while (true)
{
createAppTray(localObject2);
createFolderLayer();
createAppShareDropZone();
createTrashcan();
if (localMyInstanceState != null)
{
if (localMyInstanceState.apptrayIsOpen)
{
hideDesktopAndOpenApptay(false);
this.mAppTrayController.moveToPane(localMyInstanceState.apptrayPane);
if (localMyInstanceState.apptrayIsEditing)
this.mAppTrayController.enterEditMode();
}
if (localMyInstanceState.isInOverview)
{
this.mDesktopController.setOverviewProgress(localMyInstanceState.overviewProgress);
if (this.mCornerController != null)
this.mCornerController.hide(false);
}
if (localMyInstanceState.isFolderOpen)
{
openFolder(localMyInstanceState.openFolder, localMyInstanceState.openFolderSourceLayer, localMyInstanceState.openFolderSourceLocation, false);
if (localMyInstanceState.openFolderRenaming)
this.mFolderController.setRenamingFolder(true);
}
if ((this.mStageController != null) && (localMyInstanceState.stageCreatingFolder))
{
this.mStageController.setCreatingFolder(true);
this.mStageController.setDroppedAtInfo(localMyInstanceState.stageDroppedAtInfo);
this.mStageController.setSavedPickedUpInfo(localMyInstanceState.stageSavedPickedUpInfo);
this.mStageController.setHintLocation(localMyInstanceState.stageHintLocation);
}
if ((this.mCornerController != null) && (localMyInstanceState.openCorner != -1))
this.mCornerController.expandCorner(localMyInstanceState.openCorner, false);
this.mSavedFolderText = localMyInstanceState.savedFolderText;
this.mAddingFolder = localMyInstanceState.addingFolder;
this.mRenamingFolder = localMyInstanceState.openFolderRenaming;
this.mAddTo = localMyInstanceState.addTo;
this.mDesktopLongPressLocation = localMyInstanceState.addFolderToDesktopLocation;
this.mStageLocation = localMyInstanceState.addFolderToStageLocation;
this.mAppTrayController.setButtonsDisabled(localMyInstanceState.apptrayDisableDuringSortDialog);
}
createBadgeBroadcastReceiver();
this.mStartupMap.put("onCreate", roundToNearest100(SystemClock.uptimeMillis() - this.mOnCreateStartTime) + "");
setupSmartSlider();
Configuration localConfiguration = getResources().getConfiguration();
this.mCurrentMcc = localConfiguration.mcc;
this.mCurrentMnc = localConfiguration.mnc;
if (this.mAddingFolder)
this.mActivityFlow.addFolder(this.mAddFolderListener, this.mSavedFolderText);
if (this.mRenamingFolder)
this.mFolderController.onCreate();
return;
this.mResourceLoader = new ResourceLoader(localContext, this.mPackageLoader, this.mInfoGroupManager, ((HomeApplication)getApplication()).getBadgeManager());
this.mAdapterHelper = new AdapterHelper(localContext, this.mResourceLoader);
this.mStatistics = new Statistics(localContext, this.mPackageLoader);
break;
try
{
label990: if (((UiModeManager)getSystemService("uimode")).getCurrentModeType() != 1)
break label1025;
this.mDefaultOrientation = 5;
}
catch (NoClassDefFoundError localNoClassDefFoundError)
{
this.mDefaultOrientation = 5;
}
}
break label91;
this.mDefaultOrientation = 4;
break label91;
bool = false;
break label222;
localObject1 = null;
break label518;
}
}

this is on smali code

.method public constructor <init>()V
.locals 1

.prologue
.line 137
invoke-direct {p0}, Landroid/app/Activity;-><init>()V

.line 332
[B]const/4 v0, -0x1[/B]

iput v0, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I

thanks...