android - 如何获取堆栈大小

标签 android stack stack-overflow

我的应用程序有很深的层次结构。 我需要知道设备堆栈的大小是多少。 有办法知道吗? 在此链接中:What is the android UI thread stack size limit and how to overcome it? 我看到每个 Android 版本都有自己的堆栈大小,但我想确保并在应用程序在用户设备上运行时动态检查它。 我该怎么做?

最佳答案

I have a deep hierarchy in my app

无论堆栈空间如何,这都不是一个好主意。层次结构中的 View 越多,渲染过程的成本就越高。使用层次结构 View 检查 View 层次结构并找到删除不必要项目的方法(例如,将复合图像与 TextView 小部件一起使用,而不是在 内部使用单独的 ImageView 小部件LinearLayout)。

I need to know what is the size of the stack of the device. Is there a way to know?

标准 Java 或 Android 中没有任何内容会返回堆栈大小。

关于android - 如何获取堆栈大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20404829/

相关文章:

android - 通过 adb shell pm 删除域包

android - 连接到设备时 run-android 出现错误

android - Android 10 中无法在真实设备的手机存储中找到文件

assembly - AT&T Assembly Printing 来控制台 Segfault

c++ - 在 C++ 中调整动态堆栈分配的大小

android - 从 Location 对象获取卫星数量

c++ - 编写一个返回堆栈的函数,该堆栈包含小于给定数字的所有元素,并且顺序相同?

c - 运行 C 程序后未定义的计算机行为

Java错误: "Exception in thread "main"java. lang.StackOverflowError“构造函数中的问题

.net - 如何绕过 .NET 中未处理的异常处理来克服 StackOverflowException