One of to stop an Activity from going through onCreate() over and over again when orientation changes, is to set Activity's Orientation
in AndroidManifest.xml to say, "portrait" using below code.
<activity
android:name="com.example.YourActivity"
android:screenOrientation="portrait"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
하지만 이는 사용자가 기대하지 않을 인물 모드에서만 지원되도록 활동 UI를 제한한다는 것을 의미합니다.
그리고 우리는 안드로이드와 함께하려고하는 경우 : configChanges는 = "오리엔테이션 | 화면 크기", 시스템이 keyboardHidden을 제외하고, 당신의 활동을 다시해서는 안된다. 이 응용 프로그램을 개발하고 있다고 가정
는 API 레벨을합니다 (의 minSdkVersion 및 targetSdkVersion을 속성에 의해 선언 된) 13 이상을 대상으로, 당신은 또한 "화면 크기"구성을 선언해야합니다.
귀하의 경우 활동이 다시 생성되는 것을 중단해야하는 이유는 무엇입니까? – hmartinezd
'android : configChanges = "orientation | keyboardHidden | screenSize' 이것은 불쾌한 해킹입니다. 아래의 조언을 따르십시오. – Simon