设置 Min SDK 版本会导致应用程序无法正常运行:内存不足

发布于 2024-11-19 15:39:01 字数 292 浏览 2 评论 0原文

我正准备发布应用程序,但当我将最低 SDK 版本设置为高于 3 时,应用程序的部分内容停止工作。具体来说,我有启动新活动的按钮,每个按钮都有不同的参数,但如果设置了 Min SDK(设置为 1 以外的值),则只有其中一个按钮启动该活动。我在这里做错了什么?我不认为我缺少任何权限,因为该应用程序相对简单。

编辑:我正在查看 LogCat,我意识到似乎存在内存不足问题。启动新活动的每个按钮都告诉它加载一组要显示的图像,仍然起作用的一个按钮加载较少的图像。有没有什么方法可以让应用程序再次运行而不降低图像质量?另外,为什么更改最低 SDK 版本会影响这个?

I was getting ready to publish an app, but when I set the min SDK version to anything higher than 3, parts of my app stop working. Specifically I have buttons that launch a new activity, each with different parameters, but only one of them launches the activity if the Min SDK is set (to something other than 1). What am I doing wrong here? I don't think I'm missing any permissions, as the app is relatively simple.

Edit: I was looking at LogCat, and I realized that there seems to be an out of memory issue. Each of the buttons that launches the new activity tells it to load a certain set of images to be displayed, the one button that still functions loads less images. Is there any way to make the app function again without making the images lower quality? Also, why does changing the min SDK version affect this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱要勇敢去追 2024-11-26 15:39:01

要做的第一件事始终是查看 logcat 中打印的内容。很可能会有错误消息告诉您发生了什么。

这是关于各种最低(实际目标)SDK 级别如何修改应用程序平台行为方式的粗略文档:http://developer.android.com/reference/android/os/Build.VERSION_CODES.html

不幸的是,它可能缺少一些东西,但大多数主要差异感兴趣的都在那里。

The first thing, always, to do is to look at what is being printed in logcat. Very likely there will be error messages there telling you what is going on.

This is a rough documentation on how the various min (actually target) SDK levels modify how the platform behaves for your app: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html

Unfortunately there are probably a few things missing from it, but most of the major differences of interest are there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文