0
onCreate 함수를 시작할 때 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
을 호출합니다. 따라서 두 번 호출되지만 액티비티의 XML 파일에 android:configChanges="keyboardHidden|orientation|screenSize"
을 추가하면 읽습니다. 두 번 호출하면 안됩니다 , 필자 또한 OnConfingChanges이 같은 기능을 오버라이드 (override) :안드로이드 액티비티의 onCreate가 두 번 호출되었습니다.
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
}
이 같은 활동의 내 XML 파일이 모습입니다 : 내가 제거 왜 이러한 XML 구성 요소의 정의는 관련 그게 전부이 arent 가정
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/topedLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<activity android:configChanges="keyboardHidden|orientation|screenSize">
</activity>
<ScrollView
... >
<LinearLayout
... >
<RelativeLayout
... >
<TextView
... />
<LinearLayout
... >
<TextView
... />
<Button
... />
<Button
... />
<Button
... />
</LinearLayout>
</RelativeLayout>
<ProgressBar
... />
</LinearLayout>
</ScrollView>
<GridView
... >
</GridView>
</LinearLayout>
그들 f 또는 단순
오 덕분에 ... 아픈 immidietally이 : 아 정말 감사합니다 :) –
잘 작동하고 지금 노력하고 있습니다 ... 에뮤 내 넥서스에 대한 원인을 시도해 :) 네, –
했다 내가 그 시간에 그것을 받아 들일 수 없다는 것을 기다리고있는 원인, 그리고 나는 시간을 잊어 버렸다 : D 지금 기억하고있다 :) –