我遇到了與android對話框有關的堆棧溢出錯誤。我使用showDialog(DIALOG1)在一個語句中包含了大約21個對話框。當對話框和主要活動都包含在同一個類文件中時,顯示對話框效果很好,但是一旦我將對話框移動到另一個類文件並嘗試從主活動訪問它們,就會導致堆棧溢出錯誤。我試過在對話框類中擴展Dialog類以及擴展包含對話框的類(主要活動擴展了classOfDialogs)。我似乎無法讓對話從另一個文件訪問。有什麼建議麼?任何幫助將不勝感激!謝謝!!Android對話框通過單獨的類存儲和訪問
堆棧跟蹤(或者是我可以收集
Thread [<1> main] (Suspended (exception StackOverflowError))
Looper.myLooper() line: 137
Handler.<init>() line: 119
AlphaAthensActivity(Activity).<init>() line: 679
AlphaAthensActivity(Dialogs).<init>() line: 13
AlphaAthensActivity.<init>() line: 55
AlphaAthensActivity(Dialogs).<init>() line: 36
AlphaAthensActivity.<init>() line: 55
AlphaAthensActivity(Dialogs).<init>() line: 36
AlphaAthensActivity.<init>() line: 55
Class.newInstanceImpl() line: not available [native method]
Class.newInstance() line: 1429
Instrumentation.newActivity(ClassLoader, String, Intent) line: 1021
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2577
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679
ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125
ActivityThread$H.handleMessage(Message) line: 2033
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]
發佈你的棧跟蹤。 – FoamyGuy
我的道歉我新來堆棧溢出 –