我似乎在運行我的應用程序時間歇性地出現以下錯誤。在onCreate方法中創建一個對話框 - 泄漏
「活動已經泄露,最初這裏添加窗口[email protected]」
我做的,我的onCreate()方法就像是創造我的對話所以:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Create splash-screen object and pass in width and height (width and height are defined and valid, I just removed them from this post to make it more readable)
splash = new SplashScreen(MainActivity.this, width, height);
//Create dialog that will show splash-screen
loading_dialog = new Dialog(MainActivity.this,android.R.style.Theme_Black_NoTitleBar_Fullscreen);
//Set and display splash screen view
loading_dialog.setContentView(splash);
loading_dialog.show();
}
任何想法是什麼問題可能是?
嗨@idan,謝謝,但不起作用 - 沒有'create()'方法....我正在做的工作,錯誤只是間歇性的! :-) – Zippy
我添加了類似Q的鏈接,我希望它能幫助你... – idan