改变方向时活动消失

如何解决改变方向时活动消失

我有一个名为 XvfActivity 的活动,用于显示项目列表。当我旋转手机时,活动就会消失,日志中没有错误。该活动没有要保留的额外内容。

然后我在活动的清单中添加了以下行(不更改活动本身的任何内容):

android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" 

然后一切正常,尽管我的活动没有处理这些事件。

我可以离开这条线而忘记这个问题,但我想知道我做错了什么。我还有其他更复杂的活动,它们在清单中没有这一行就可以很好地旋转。

这是轮换事件中的 logcat(所有应用,>= 警告),我的应用名为 com.floritfoto.apps.xvf

 23:29:26.122 9965-9965/? W/DividerImeController: onImeStartPositioning mTargetShown=false isDividerVisible=false
 23:29:24.516 2401-2409/? E/perfsdkserver: [Interface] BpPerfSDKService::connectionRequest()
 23:29:24.755 779-2278/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::acquire()
 23:29:25.495 6737-6737/? W/adbd: timeout expired while flushing socket,closing
--- beginning of system
 23:29:25.539 9655-9689/? W/ImageReader_JNI: Unable to acquire a buffer item,very likely client tried to acquire more than maxImages buffers
 23:29:25.592 9466-9483/? E/HYPER-HAL: [HandlerSysfs.cpp]doResourceHandling(): Couldn't Open Sysfs - /sys/power/cstate_control
 23:29:25.611 10194-10194/? W/SGestureOverlayWindow: removeGestureOverlayWindow return by mOverlayWindow == null
 23:29:25.627 779-1080/? E/BufferQueueProducer: [ScreenDecorOverlay$_9965#0](id:30b00001aeb,api:0,p:-1,c:779) disconnect: not connected (req=1)
 23:29:25.627 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542e6d00 disconnect failed
 23:29:25.644 779-1080/? E/BufferQueueProducer: [ScreenDecorOverlay$_9965#0](id:30b00001aeb,c:779) disconnect: not connected (req=1)
 23:29:25.644 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542e6d00 disconnect failed
 23:29:25.674 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{d7157ad V.E...C.. ......ID 805,8-805,8 #0} during layout: running second layout pass
 23:29:25.674 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{ec73ae2 V.E...C.. ......ID 805,8 #1} during layout: running second layout pass
 23:29:25.674 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{b911e73 V.E...C.. ......ID 805,8 #2} during layout: running second layout pass
 23:29:25.674 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{4033130 V.E...C.. ......ID 805,8 #3} during layout: running second layout pass
 23:29:25.682 9965-10556/? E/TaskStackListenerAbstract: onTaskSnapshotChanged called by Binder.getCallingPid() 0 android.app.ITaskStackListener$Stub.onTransact:587 android.os.Binder.execTransactInternal:1195 android.os.Binder.execTransact:1159 <bottom of call stack>
 23:29:25.685 779-836/? E/BufferQueueProducer: [com.floritfoto.apps.xvf/com.floritfoto.apps.xvf.XvfActivity$_11131#0](id:30b00002a5b,c:779) disconnect: not connected (req=1)
 23:29:25.685 11131-12824/com.floritfoto.apps.xvf W/libEGL: EGLNativeWindowType 0x7254353630 disconnect failed
 23:29:25.697 12679-15672/? E/TaskStackListenerAbstract: onTaskSnapshotChanged called by Binder.getCallingPid() 0 android.app.ITaskStackListener$Stub.onTransact:587 android.os.Binder.execTransactInternal:1195 android.os.Binder.execTransact:1159 <bottom of call stack>
 23:29:25.723 779-1871/? E/BufferQueueProducer: [StatusBar$_9965#0](id:30b00001aea,c:779) disconnect: not connected (req=1)
 23:29:25.723 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542eb120 disconnect failed
 23:29:25.749 779-1871/? E/BufferQueueProducer: [NavigationBar0$_9965#0](id:30b00001ae9,c:779) disconnect: not connected (req=1)
 23:29:25.750 9965-10461/? W/libEGL: EGLNativeWindowType 0x725430b010 disconnect failed
 23:29:25.782 9655-10092/? E/ActivityThread: Failed to find provider info for com.sec.android.desktopmode.uiservice.SettingsProvider
 23:29:25.782 9655-10092/? E/InputMethodManagerService: Failed to get settings
 23:29:25.795 9655-9890/? E/PkgPredictorService-Collector: record changed bt=0  wifi=1 screen=1
 23:29:25.797 9466-9466/? E/HYPER-HAL: [SysfsControlManager.cpp]writeSysfs(): Couldn't Open Sysfs - /sys/kernel/ert/boost_frt_threshold
 23:29:25.836 9655-9774/? E/WallpaperManagerService: landscapeColors is calculated already
 23:29:25.837 9655-11051/? W/WindowManager: Failed looking up window session=Session{b5ac8c2 11131:u0a10369} callers=com.android.server.wm.WindowManagerService.windowForClientLocked:6102 com.android.server.wm.Session.insetsModified:506 android.view.IWindowSession$Stub.onTransact:1383
 23:29:25.885 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: beginBatchEdit on inactive InputConnection
 23:29:25.885 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: endBatchEdit on inactive InputConnection
 23:29:25.892 9466-9483/? E/HYPER-HAL: [HandlerSysfs.cpp]doResourceHandling(): Couldn't Open Sysfs - /sys/power/cstate_control
 23:29:25.896 9655-11499/? W/WindowManager: Execute app transition: mNextAppTransition=TRANSIT_TASK_CLOSE,displayId: 0 Callers=com.android.server.wm.RootWindowContainer.executeAppTransitionForAllDisplay:2586 com.android.server.wm.ActivityStackSupervisor.reportResumedActivityLocked:2225 com.android.server.wm.ActivityRecord.completeResumeLocked:5646 com.android.server.wm.ActivityStack.resumeTopActivityInnerLocked:2409 com.android.server.wm.ActivityStack.resumeTopActivityUncheckedLocked:1860
 23:29:25.898 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: getExtractedText on inactive InputConnection
 23:29:25.915 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
 23:29:25.915 10602-10602/? E/FullInputEventModel: onStartInputView event aborted: i73: Could not create reset composing text event (class i73)
 23:29:25.950 9466-9466/? E/HYPER-HAL: [SysfsControlManager.cpp]writeSysfs(): Couldn't Open Sysfs - /sys/kernel/ert/boost_frt_threshold
 23:29:25.995 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: getExtractedText on inactive InputConnection
 23:29:25.996 10602-10602/? E/InputMethodService: Unexpected null in startExtractingText : mExtractedText = null,input connection = InputConnectionWrapper{idHash=#57aad15 mMissingMethods=}
 23:29:25.998 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: getExtractedText on inactive InputConnection
 23:29:25.999 10602-10602/? E/InputMethodService: Unexpected null in startExtractingText : mExtractedText = null,input connection = InputConnectionWrapper{idHash=#57aad15 mMissingMethods=}
 23:29:26.044 11131-11131/com.floritfoto.apps.xvf W/IInputConnectionWrapper: getExtractedText on inactive InputConnection
 23:29:26.045 11163-11163/? E/Nova.DragLayer: Ignoring measure for invalid size. Landscape:false MeasureSpec: EXACTLY 2400 MeasureSpec: EXACTLY 1080
 23:29:26.046 779-1871/? E/BufferQueueProducer: [com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaLauncher$_11163#0](id:30b00002a5f,c:779) disconnect: not connected (req=1)
 23:29:26.046 11163-11321/? W/libEGL: EGLNativeWindowType 0x7254404160 disconnect failed
 23:29:26.048 10602-10602/? E/InputMethodService: Unexpected null in startExtractingText : mExtractedText = null,input connection = InputConnectionWrapper{idHash=#57aad15 mMissingMethods=}
 23:29:26.054 779-836/? E/BufferQueueProducer: [com.floritfoto.apps.xvf/com.floritfoto.apps.xvf.XvfActivity$_11131#0](id:30b00002a5e,c:779) disconnect: not connected (req=1)
 23:29:26.054 11131-12824/com.floritfoto.apps.xvf W/libEGL: EGLNativeWindowType 0x7254353630 disconnect failed
 23:29:26.118 10602-10602/? E/FullInputEventModel: selectionUpdated event aborted: i73: Could not create selection changed event (class i73)
 23:29:26.120 11163-11163/? E/Nova.DragLayer: Ignoring measure for invalid size. Landscape:false MeasureSpec: EXACTLY 2400 MeasureSpec: EXACTLY 1080
 23:29:26.122 9965-9965/? W/DividerImeController: onImeStartPositioning mTargetShown=false isDividerVisible=false
 23:29:26.138 11163-11163/? E/Nova.DragLayer: Ignoring measure for invalid size. Landscape:false MeasureSpec: EXACTLY 2400 MeasureSpec: EXACTLY 1080
 23:29:26.139 779-2026/? E/BufferQueueProducer: [InputMethod$_10602#0](id:30b00002a5c,c:779) disconnect: not connected (req=1)
 23:29:26.139 10602-10687/? W/libEGL: EGLNativeWindowType 0x72545bcc50 disconnect failed
 23:29:26.164 11163-11163/? E/Nova.DragLayer: Ignoring measure for invalid size. Landscape:false MeasureSpec: EXACTLY 2400 MeasureSpec: EXACTLY 1080
 23:29:26.190 9655-9692/? W/ImageReader_JNI: Unable to acquire a buffer item,very likely client tried to acquire more than maxImages buffers
 23:29:26.241 9655-9692/? W/ImageReader_JNI: Unable to acquire a buffer item,very likely client tried to acquire more than maxImages buffers
 23:29:26.274 735-1254/? E/Sensors: Sensor : Meta event
 23:29:26.300 9466-9483/? E/HYPER-HAL: [HandlerSysfs.cpp]doResourceHandling(): Couldn't Open Sysfs - /sys/power/cstate_control
 23:29:26.309 10194-10194/? W/SGestureOverlayWindow: removeGestureOverlayWindow return by mOverlayWindow == null
 23:29:26.311 779-837/? E/BufferQueueProducer: [com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaLauncher$_11163#0](id:30b00002a5f,c:779) disconnect: not connected (req=1)
 23:29:26.311 11163-11321/? W/libEGL: EGLNativeWindowType 0x7254404160 disconnect failed
 23:29:26.327 9655-11499/? W/ActivityTaskManager: Finishing task with all activities already finished
 23:29:26.327 9655-11499/? W/ActivityTaskManager: Duplicate finish request for r=ActivityRecord{3e4e083 u0 com.floritfoto.apps.xvf/.XvfActivity t46752 f}}
 23:29:26.329 779-1080/? E/BufferQueueProducer: [ScreenDecorOverlay$_9965#0](id:30b00001aeb,c:779) disconnect: not connected (req=1)
 23:29:26.329 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542e6d00 disconnect failed
 23:29:26.338 779-2026/? E/BufferQueueProducer: [com.android.systemui.ImageWallpaper$_9965#0](id:30b00001ae8,c:779) disconnect: not connected (req=1)
 23:29:26.339 9965-10112/? W/libEGL: EGLNativeWindowType 0x72542dc2b0 disconnect failed
 23:29:26.342 779-1871/? E/BufferQueueProducer: [ScreenDecorOverlay$_9965#0](id:30b00001aeb,c:779) disconnect: not connected (req=1)
 23:29:26.342 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542e6d00 disconnect failed
 23:29:26.343 11163-11163/? W/Settings: Setting always_finish_activities has moved from android.provider.Settings.System to android.provider.Settings.Global,returning read-only value.
 23:29:26.357 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{9e59be V.E...C.. ......ID 494,22-494,22 #0} during layout: running second layout pass
 23:29:26.357 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{9b84a1f V.E...C.. ......ID 494,22 #1} during layout: running second layout pass
 23:29:26.357 9965-9965/? W/View: requestLayout() improperly called by android.widget.LinearLayout{d07316c V.E...C.. ......ID 494,22 #2} during layout: running second layout pass
 23:29:26.373 779-2026/? E/BufferQueueProducer: [StatusBar$_9965#0](id:30b00001aea,c:779) disconnect: not connected (req=1)
 23:29:26.373 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542eb120 disconnect failed
 23:29:26.393 779-837/? E/BufferQueueProducer: [NavigationBar0$_9965#0](id:30b00001ae9,c:779) disconnect: not connected (req=1)
 23:29:26.393 9965-10461/? W/libEGL: EGLNativeWindowType 0x725430b010 disconnect failed
 23:29:26.434 779-1080/? E/BufferQueueProducer: [StatusBar$_9965#0](id:30b00001aea,c:779) disconnect: not connected (req=1)
 23:29:26.434 9965-10461/? W/libEGL: EGLNativeWindowType 0x72542eb120 disconnect failed
 23:29:26.449 779-1871/? E/BufferQueueProducer: [NavigationBar0$_9965#0](id:30b00001ae9,c:779) disconnect: not connected (req=1)
 23:29:26.449 9965-10461/? W/libEGL: EGLNativeWindowType 0x725430b010 disconnect failed
 23:29:26.471 9655-11808/? W/WindowManager: Execute app transition: mNextAppTransition=TRANSIT_NONE,displayId: 0 Callers=com.android.server.wm.WindowManagerService.prepareNoneTransitionForRelaunching:2145 com.android.server.wm.WindowManagerService.addWindow:1929 com.android.server.wm.Session.addToDisplayAsUser:180 android.view.IWindowSession$Stub.onTransact:695 com.android.server.wm.Session.onTransact:143
 23:29:26.485 11163-11163/? E/Nova.DragLayer: Ignoring measure for invalid size. Landscape:true MeasureSpec: EXACTLY 1080 MeasureSpec: EXACTLY 2400
 23:29:26.501 9655-11201/? W/WindowManager: Execute app transition: mNextAppTransition=TRANSIT_NONE,displayId: 0 Callers=com.android.server.wm.ActivityStack.executeAppTransition:4009 com.android.server.wm.RootWindowContainer.resumeFocusedStacksTopActivities:2690 com.android.server.wm.RootWindowContainer.resumeFocusedStacksTopActivities:2652 com.android.server.wm.ActivityRecord.destroyed:3549 com.android.server.wm.ActivityTaskManagerService.activityDestroyed:2617
 23:29:26.501 9655-11201/? W/WindowManager: Execute app transition: mNextAppTransition=TRANSIT_NONE,displayId: 0 Callers=com.android.server.wm.ActivityStack.executeAppTransition:4009 com.android.server.wm.ActivityStack.resumeTopActivityInnerLocked:1981 com.android.server.wm.ActivityStack.resumeTopActivityUncheckedLocked:1860 com.android.server.wm.RootWindowContainer.resumeFocusedStacksTopActivities:2715 com.android.server.wm.RootWindowContainer.resumeFocusedStacksTopActivities:2652
 23:29:26.508 11163-11163/? E/Nova.DragLayer: Ignoring measure for invalid size. Landscape:true MeasureSpec: EXACTLY 1080 MeasureSpec: EXACTLY 2400
 23:29:26.517 9965-9965/? E/ExpandableNotifRow: onNotificationUpdated() NSSL is null..
 23:29:26.520 10602-10617/? W/System: A resource failed to call close.
 23:29:26.538 9655-11201/? E/WallpaperManagerService: landscapeColors is calculated already
 23:29:26.539 779-1871/? E/BufferQueueProducer: [com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaLauncher$_11163#0](id:30b00002a61,c:779) disconnect: not connected (req=1)
 23:29:26.539 11163-11321/? W/libEGL: EGLNativeWindowType 0x7254404160 disconnect failed
 23:29:26.546 11163-11163/? W/Settings: Setting always_finish_activities has moved from android.provider.Settings.System to android.provider.Settings.Global,returning read-only value.
 23:29:26.633 9655-9915/? W/WindowManager: Failed looking up window session=Session{5b4d5a4 11163:u0a10297} callers=com.android.server.wm.WindowManagerService.windowForClientLocked:6102 com.android.server.wm.Session.insetsModified:506 android.view.IWindowSession$Stub.onTransact:1383
 23:29:26.634 9655-9915/? W/WindowManager: Failed looking up window session=Session{5b4d5a4 11163:u0a10297} callers=com.android.server.wm.WindowManagerService.windowForClientLocked:6102 com.android.server.wm.Session.insetsModified:506 android.view.IWindowSession$Stub.onTransact:1383
 23:29:26.692 9466-13427/? E/HYPER-HAL: [HandlerSysfs.cpp]doResourceHandling(): Couldn't Open Sysfs - /sys/power/cstate_control
 23:29:26.888 779-1871/? E/BufferQueueProducer: [InputMethod$_10602#0](id:30b00002a5c,c:779) disconnect: not connected (req=1)
 23:29:26.888 10602-10687/? W/libEGL: EGLNativeWindowType 0x72545bcc50 disconnect failed
 23:29:26.889 9655-9915/? E/WindowManager: win=Window{902a6a5 u0 InputMethod} destroySurfaces: appStopped=true win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=8 caller=com.android.server.wm.WindowManagerService.tryStartExitingAnimation:2903 com.android.server.wm.WindowManagerService.relayoutWindow:2611 com.android.server.wm.Session.relayout:217 android.view.IWindowSession$Stub.onTransact:856 com.android.server.wm.Session.onTransact:143 android.os.Binder.execTransactInternal:1190 android.os.Binder.execTransact:1159
 23:29:26.908 9655-9692/? W/ImageReader_JNI: Unable to acquire a buffer item,very likely client tried to acquire more than maxImages buffers
 23:29:26.935 779-2278/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::acquire()
 23:29:27.300 9466-13419/? E/HYPER-HAL: [HandlerSysfs.cpp]doResourceHandling(): Couldn't Open Sysfs - /sys/power/cstate_control

我知道我没有提供太多数据,但我根本不知道问题出在哪里,因为我在日志中没有看到相关错误(或者,更好的是,我应该说我不明白)。对此表示抱歉。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-