80,351
社区成员
发帖
与我相关
我的任务
分享
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): FATAL EXCEPTION: main
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewRoot.setView(ViewRoot.java:514)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.Window$LocalWindowManager.addView(Window.java:424)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.widget.MediaController.show(MediaController.java:304)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.widget.MediaController.show(MediaController.java:249)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.widget.VideoView.toggleMediaControlsVisiblity(VideoView.java:561)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.widget.VideoView.onTouchEvent(VideoView.java:512)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.View.dispatchTouchEvent(View.java:3766)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1720)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1117)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1704)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.view.ViewRoot.handleMessage(ViewRoot.java:1794)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.os.Handler.dispatchMessage(Handler.java:99)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.os.Looper.loop(Looper.java:143)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at android.app.ActivityThread.main(ActivityThread.java:4701)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at java.lang.reflect.Method.invokeNative(Native Method)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at java.lang.reflect.Method.invoke(Method.java:521)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-18 09:39:22.759: ERROR/AndroidRuntime(2114): at dalvik.system.NativeStart.main(Native Method)
VideoView player = new VideoView(ctx);
MediaController mctrl = new MediaController(ctx);
mctrl.show();
player.setMediaController(mctrl);
player.setVideoURI(url);
player.requestFocus();
player.start();
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
"mcc" The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC.
"mnc" The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC.
"locale" The locale has changed — the user has selected a new language that text should be displayed in.
"touchscreen" The touchscreen has changed. (This should never normally happen.)
"keyboard" The keyboard type has changed — for example, the user has plugged in an external keyboard.
"keyboardHidden" The keyboard accessibility has changed — for example, the user has revealed the hardware keyboard.
"navigation" The navigation type (trackball/dpad) has changed. (This should never normally happen.)
"orientation" The screen orientation has changed — the user has rotated the device.
"screenLayout" The screen layout has changed — this might be caused by a different display being activated.
"fontScale" The font scaling factor has changed — the user has selected a new global font size.
"uiMode" The user interface mode has changed — this can be caused when the user places the device into a desk/car dock or when the the night mode changes. See UiModeManager. Introduced in API Level 8.