我的junit测试从我的Eclipse环境中通过ant 1.7运行,但是在执行junitreport任务时构建失败:
BUILD FAILED .../build.xml:222:应用转换时的错误:javax.xml.transform.TransformerException:java.lang.RuntimeException:使用扩展函数'xalan://org.apache.tools.ant.util当安全处理功能设置为true时,不允许使用.stringUtils:replace'.
我试图弄清楚如何使junitreport任务禁用安全处理功能(我不需要并且此时只是我的方式)但我不知道如何因为任务没有要禁用的属性它.或者我应该做些什么来使这项工作?
我知道,这个问题之前在stackoverflow上被问到,但是没有答案对我有用.
可能值得一提的是:
onSaveInstanceState
我按下主页按钮时调用方法IS.该方法onCreate
总是为NULL提供NULL Bundle savedInstanceState
.onRestoreInstanceState
从来没有调用过方法.(我不介意,如果onCreate
工作;)).super.onSaveInstanceState(outState)
底部onSaveInstanceState
.也没有运气.这是代码.我希望有人有这个问题并解决了它.
public class MainActivity extends SherlockFragmentActivity {
private static final String LOG_TAG = MainActivity.class.getSimpleName();
private static String STATE_TO_STORE = "state_to_store";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(LOG_TAG, "onCreate: savedInstanceState = " + (savedInstanceState == null ? "NULL" : "Not NULL"));
// ... more code...
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
Log.d(LOG_TAG, "onRestoreInstanceState: savedInstanceState = " + (savedInstanceState == …
Run Code Online (Sandbox Code Playgroud)