现象描述
测试提供了一个 很抱歉,"计算器"已停止运行的BUG。
log
Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
查看代码:
百度为 requestWindowFeature 必须在 setContentView之前,如此设置之后,依然有BUG。
解决
查看清单文件
<activity android:name="Calculator"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.APP_CALCULATOR" />
</intent-filter>
</activity>
可能与
冲突了,测试并未重现 "计算器"已停止运行的BUG。