Android 台灣中文網
標題: 關於翻轉得到的錯誤訊息 [打印本頁]
作者: youandyw 時間: 2013-11-11 15:19
標題: 關於翻轉得到的錯誤訊息
我翻轉的時候發現TextView裡面的資料會被清空,上網查每次翻轉都會onCreate,因此找到解決方案是在xml裡面放置
以下是放置的xml訊息
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.health_control"
- android:versionCode="1"
- android:versionName="1.0" >
- <uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="18" />
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.abc_control.MainActivity"
- android:label="@string/app_name"
- android:configChanges="orientation|keyboardHidden" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity
- android:name="com.example.abc_control.Activity_ABC"
- android:configChanges="orientation|keyboardHidden" >
- </activity>
- </application>
- </manifest>
複製代碼
之後執行發現翻轉還是一樣出現問題,看了一下錯誤訊息顯示