gpt4 book ai didi

android - Webview - 窗口已经聚焦,忽略了焦点增益

转载 作者:行者123 更新时间:2023-11-29 01:47:30 28 4
gpt4 key购买 nike

我的应用程序集成了 Vimeo HTML5WebView。视频在纵向模式(在所有设备上)时运行良好,但当方向更改为横向时,视频开始闪烁。
这种情况发生在平板电脑上 - 在 7 英寸和 10 英寸平板电脑上。当视频闪烁时,我在 logcat 中收到警告说,窗口已经聚焦,忽略了焦点增益。

请引用下面的 logcat。
我尝试在 StackOverflow 上查看各种问题,但找不到合适的解决方案。

12-13 14:15:11.730: D/dalvikvm(505): JIT code cache reset in 1 ms (1048548 bytes 8/0)
12-13 14:15:11.740: D/dalvikvm(505): GC_EXPLICIT freed 868K, 25% free 18906K/24960K, paused 5ms+7ms, total 131ms
12-13 14:15:12.521: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4286b2f0 attribute=null, token = android.os.BinderProxy@42458f80
12-13 14:15:12.531: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:12.621: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:16.915: I/AwesomePlayer(180): cache is running low (1.58 secs) , pausing.
12-13 14:15:16.915: W/MediaPlayer(22724): info/warning (703, 1843)
12-13 14:15:16.915: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:16.925: I/MediaPlayer(22724): Info (703,1843)
12-13 14:15:16.925: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:19.928: D/audio_hw_primary(180): out_standby: enter: usecase(1: low-latency-playback)
12-13 14:15:19.988: D/audio_hw_primary(180): stop_output_stream: enter: usecase(1: low-latency-playback)
12-13 14:15:19.988: D/audio_hw_primary(180): disable_audio_route: reset mixer path: low-latency-playback
12-13 14:15:19.988: D/audio_hw_primary(180): disable_snd_device: snd_device(2: speaker)
12-13 14:15:19.998: D/audio_hw_primary(180): stop_output_stream: exit: status(0)
12-13 14:15:19.998: D/audio_hw_primary(180): out_standby: exit
12-13 14:15:27.916: I/AwesomePlayer(180): cache has filled up (6.09 secs), resuming.
12-13 14:15:27.916: W/MediaPlayer(22724): info/warning (702, 0)
12-13 14:15:27.936: D/audio_hw_primary(180): start_output_stream: enter: usecase(1: low-latency-playback) devices(0x2)
12-13 14:15:27.936: D/audio_hw_primary(180): select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
12-13 14:15:27.936: D/audio_hw_primary(180): enable_snd_device: sending audio calibration for snd_device(2) acdb_id(14)
12-13 14:15:27.936: D/ACDB-LOADER(180): ACDB -> send_afe_cal
12-13 14:15:27.936: D/audio_hw_primary(180): enable_snd_device: snd_device(2: speaker)
12-13 14:15:27.946: D/audio_hw_primary(180): enable_audio_route: apply mixer path: low-latency-playback
12-13 14:15:27.956: D/audio_hw_primary(180): start_output_stream: exit
12-13 14:15:28.016: I/MediaPlayer(22724): Info (702,0)
12-13 14:15:29.608: I/InputReader(505): Reconfiguring input devices. changes=0x00000004
12-13 14:15:29.608: I/InputReader(505): Device reconfigured: id=6, name='elan-touchscreen', size 1200x1920, orientation 1, mode 1, display id 0
12-13 14:15:29.608: I/InputReader(505): Reconfiguring input devices. changes=0x00000004
12-13 14:15:29.608: I/InputReader(505): Device reconfigured: id=6, name='elan-touchscreen', size 1200x1920, orientation 1, mode 1, display id 0
12-13 14:15:29.608: I/ActivityManager(505): Config changes=1480 {1.0 404mcc?mnc en_US ldltr sw600dp w960dp h527dp 320dpi lrg land finger -keyb/v/h -nav/h s.51}
12-13 14:15:29.678: D/audio_hw_primary(180): adev_set_parameters: enter: rotation=90
12-13 14:15:29.678: D/audio_hw_primary(180): adev_set_parameters: exit with code(0)
12-13 14:15:29.748: D/PhoneStatusBar(587): mSettingsPanelGravity = 8388661
12-13 14:15:29.808: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:29.828: I/WindowManager(505): Screen frozen for +274ms due to Window{4290b200 u0 Panel:com.xx.xxx/com.xx.xxx.WebViewActivity}
12-13 14:15:29.908: E/CABL(203): MSMFB_HISTOGRAM_STOP failed!
12-13 14:15:31.970: D/dalvikvm(505): GC_EXPLICIT freed 858K, 25% free 18826K/24960K, paused 7ms+5ms, total 120ms
12-13 14:15:32.911: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4283d658 attribute=null, token = android.os.BinderProxy@42458f80
12-13 14:15:32.921: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:32.961: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:35.924: I/AwesomePlayer(180): cache is running low (1.84 secs) , pausing.
12-13 14:15:35.934: W/MediaPlayer(22724): info/warning (703, 1811)
12-13 14:15:35.934: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:35.934: I/MediaPlayer(22724): Info (703,1811)
12-13 14:15:35.934: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:36.064: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@423e5920 attribute=null, token = android.os.BinderProxy@42458f80
12-13 14:15:36.074: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:36.184: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:36.785: W/MediaPlayer(22724): info/warning (702, 0)
12-13 14:15:36.785: I/MediaPlayer(22724): Info (702,0)
12-13 14:15:37.045: I/NuCachedSource2(180): new range: offset= 32665175
12-13 14:15:38.967: D/audio_hw_primary(180): out_standby: enter: usecase(1: low-latency-playback)
12-13 14:15:39.007: D/audio_hw_primary(180): stop_output_stream: enter: usecase(1: low-latency-playback)
12-13 14:15:39.007: D/audio_hw_primary(180): disable_audio_route: reset mixer path: low-latency-playback
12-13 14:15:39.007: D/audio_hw_primary(180): disable_snd_device: snd_device(2: speaker)
12-13 14:15:39.007: D/audio_hw_primary(180): stop_output_stream: exit: status(0)
12-13 14:15:39.007: D/audio_hw_primary(180): out_standby: exit
12-13 14:15:39.978: D/audio_hw_primary(180): start_output_stream: enter: usecase(1: low-latency-playback) devices(0x2)
12-13 14:15:39.978: D/audio_hw_primary(180): select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
12-13 14:15:39.978: D/audio_hw_primary(180): enable_snd_device: sending audio calibration for snd_device(2) acdb_id(14)
12-13 14:15:39.978: D/ACDB-LOADER(180): ACDB -> send_afe_cal
12-13 14:15:39.978: D/audio_hw_primary(180): enable_snd_device: snd_device(2: speaker)
12-13 14:15:39.978: D/audio_hw_primary(180): enable_audio_route: apply mixer path: low-latency-playback
12-13 14:15:39.978: I/AwesomePlayer(180): cache is running low (0.07 secs) , pausing.
12-13 14:15:39.978: W/MediaPlayer(22724): info/warning (703, 1625)
12-13 14:15:39.978: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:39.978: W/MediaPlayer(22724): info/warning (702, 0)
12-13 14:15:39.988: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:39.988: D/audio_hw_primary(180): start_output_stream: exit
12-13 14:15:40.008: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:40.088: I/MediaPlayer(22724): Info (703,1625)
12-13 14:15:40.088: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:40.088: I/MediaPlayer(22724): Info (702,0)
12-13 14:15:40.088: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4221e640 attribute=null, token = android.os.BinderProxy@42458f80
12-13 14:15:40.969: I/AwesomePlayer(180): cache is running low (1.45 secs) , pausing.
12-13 14:15:40.969: W/MediaPlayer(22724): info/warning (703, 1625)
12-13 14:15:40.969: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:40.969: I/MediaPlayer(22724): Info (703,1625)
12-13 14:15:40.969: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:42.640: D/dalvikvm(22724): GC_FOR_ALLOC freed 420K, 4% free 11555K/12012K, paused 24ms, total 24ms
12-13 14:15:43.101: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4215b9e0 attribute=null, token = android.os.BinderProxy@42458f80

如果 webview 代码有帮助,请告诉我,我会将其添加到我的问题中。从我在 StackOverflow 上看到的问题来看,我觉得,这可能是一个配置问题,在我的 webview 代码中,我已经覆盖了 onConfigurationChanged() 并且还包括了 android: configChanges 到 WebViewActivity。

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
<activity android:name=".WebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"/>

感谢您的帮助!!!

最佳答案

通过放置

android:configChanges="orientation"

对于您的 Activity ,您是在向系统表明您的 Activity 将处理方向更改。但你并没有真正做任何事情,因为你所做的只是:

super.onConfigurationChanged(newConfig);

那么,如何解决您的问题?

  1. 您说您遇到了方向更改仅发生在大屏幕(平板电脑)和 esp 上的问题。从纵向更改为横向时。当电话设备上发生方向更改时,你看不到这个问题。这让我觉得视频质量可能不够好,无法在横向模式下播放。真的吗?即,如果您最初以横向模式启动 Activity,您是否仍然看到闪烁?

  2. 您确定这不是设备特定问题吗?即,您描述的这个问题是出现在所有大屏幕设备上还是只出现在您正在测试的设备上?

  3. 您说过您正在使用 Vimeo HTML5WebView 来呈现视频。您是否尝试过平台提供的常规 WebView,框架提供的小部件是否也会出现类似问题?

  4. 最后但并非最不重要的一点是,您始终可以保存播放器的状态(例如视频在方向之前的时间戳),然后在方向更改后使用该状态恢复您的 WebView 。为此,请停止自己处理配置,然后遵循 Saving Activity State 中提到的指南。和 Handling configuration changesHandling Runtime Changes .如果您完全相信自己可以处理配置更改,那就继续做吧,但不要只是调用 super 并期望系统神奇地为您处理 Activity 对象状态。

希望这对您有所帮助。

关于android - Webview - 窗口已经聚焦,忽略了焦点增益,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20562536/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com