点击(此处)折叠或打开
-
10-21 08:39:12.314: E/AndroidRuntime(969): FATAL EXCEPTION: main
-
10-21 08:39:12.314: E/AndroidRuntime(969): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@40519318 is not valid; is your activity running?
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.view.ViewRoot.setView(ViewRoot.java:527)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.view.Window$LocalWindowManager.addView(Window.java:424)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.app.Dialog.show(Dialog.java:241)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.widget.Spinner.performClick(Spinner.java:260)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.view.View$PerformClick.run(View.java:9080)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.os.Handler.handleCallback(Handler.java:587)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.os.Handler.dispatchMessage(Handler.java:92)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.os.Looper.loop(Looper.java:123)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at android.app.ActivityThread.main(ActivityThread.java:3683)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at java.lang.reflect.Method.invokeNative(Native Method)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at java.lang.reflect.Method.invoke(Method.java:507)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
-
10-21 08:39:12.314: E/AndroidRuntime(969): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
- 10-21 08:39:12.314: E/AndroidRuntime(969): at dalvik.system.NativeStart.main(Native Method)
点击(此处)折叠或打开
- setContentView(R.layout.XX);
点击(此处)折叠或打开
-
View viewToLoad = LayoutInflater.from(this.getParent()).inflate(R.layout.XX, null);
- this.setContentView(viewToLoad)
Android的两层TAB嵌套有好多问题啊。期待GOOGLE能解决一下。