V PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@170f78f, this = DecorView@212a1c[MainActivity]
时间: 2024-04-04 18:36:02 浏览: 22
这似乎是一段Android应用程序的日志输出,其中V表示该日志级别为Verbose,PhoneWindow表示窗口管理器,DecorView表示窗口的装饰视图,setVisiblity表示设置视图的可见性,visibility = 0表示视图被设置为不可见,Parent表示该视图的父视图,this表示该视图本身。这条日志可能是在关闭或隐藏MainActivity中的视图时生成的。
相关问题
出现以下报错的原因,改怎么解决,修改哪里2023-06-06 22:04:47.620 3151-3151/com.example.notepad E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.notepad, PID: 3151 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.notepad/com.example.notepad.MainActivity}: android.view.InflateException: Binary XML file line #32: addView(View, LayoutParams) is not supported in AdapterView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2954) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3089) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1819) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6737) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860) Caused by: android.view.InflateException: Binary XML file line #32: addView(View, LayoutParams) is not supported in AdapterView Caused by: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView at android.widget.AdapterView.addView(AdapterView.java:503) at android.view.LayoutInflater.rInflate(LayoutInflater.java:867) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:420) at android.app.Activity.setContentView(Activity.java:2772) at com.example.notepad.MainActivity.onCreate(MainActivity.java:30) at android.app.Activity.performCreate(Activity.java:7144) at android.app.Activity.performCreate(Activity.java:7135) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2934) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3089) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1819) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6737) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
这个报错的原因是在一个 AdapterView 中使用了 addView() 方法,而这个方法是不支持在 AdapterView 中使用的。根据报错信息,您的问题可能出现在您的 MainActivity 的第 30 行。请检查该行代码所在的布局文件,确保其中没有在 AdapterView 中使用 addView() 方法。如果有,请将其删除或替换为适当的方法。
另外,也请确保您的应用程序中的所有布局文件都正确地使用了布局约束和布局规则。如果您还没有使用这些约束和规则,请查阅 Android 官方文档以了解更多信息。
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE 是在AOSP 中哪里处理的
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE)是在Android Framework中的PhoneWindow类中处理的。
在PhoneWindow类中,有一个名为"setDecorView"的方法,它是在Activity的onCreate方法中被调用的。setDecorView方法的作用是将Activity的布局添加到Window中,并设置相应的系统UI标志位。
在setDecorView方法中,会调用WindowManager的addView方法将Activity的布局添加到Window中,并设置相应的系统UI标志位。其中就包括View.SYSTEM_UI_FLAG_LAYOUT_STABLE标志,它表示在布局时要考虑状态栏和导航栏的大小,使得布局稳定不会因为状态栏和导航栏的变化而发生抖动。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)