-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 中的意料之外的应用崩溃以及解决它们的方法 #7849
Android 中的意料之外的应用崩溃以及解决它们的方法 #7849
Conversation
@lsvih 校对认领 |
@zenblo 好的~ |
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
|
||
Every android app runs in its own process and this process has been allocated some memory by the Operating System. When your app is put in the background while the user interacts with other applications, the OS can kill your app process if there’s not enough memory available for your application. This generally occurs when another app is being run in the foreground which demands greater phone memory (RAM). | ||
当应用程序进程终止时,所有数据对象和临时数据会丢失。而当您返回到应用程序时,系统将创建一个新的进程,并且您的应用程序将从堆栈顶部的 Activity 中恢复。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
并且您的应用程序将从堆栈顶部的 Activity 中恢复。
=>并且您的应用程序将从堆栈顶部的活动(activity )中恢复。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Activity算专有名词了,安卓开发不知道真的不太好意思了这个
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
|
||
When the user navigates back to the app from the background, if the app process was killed, the app would restart from the SplashActivity as if it is a fresh app launch. | ||
当用户从后台导航回被结束了的应用程序时候,该应用程序将从 SplashActivity 重新启动,就好像它是一个全新的应用程序启动一样。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就好像它是一个全新的应用程序启动一样
=>就好像是启动一个全新的应用程序一样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是全新的...吧,应用程序又木有重装(
这个翻译很难搞,我改成了 [就好像它是应用程序一次新的启动一样]
|
||
By now, you must have noticed that you can save and access data from ‘Bundle’ objects. Save all the necessary information in each Activity/Fragment similar to how we have done in the previous example. | ||
现在,您必须已经注意到可以保存和访问打包的数据。与前面的示例类似,将所有必要的信息保存在每个 Activity / Fragment 中。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
将所有必要的信息保存在每个活动或片段(Activity/Fragment)中
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,并且也不应该翻译为片段吧(
|
||
Since we are accessing data that was saved in a bundle, the app crash should be prevented and the app should resume from where it was left off. All the other Activities/Fragments would also be recreated. | ||
由于我们会访问保存在打包的数据,这会防止应用程序读取遗失的数据,从而防止应用崩溃崩溃。并且该应用程序会从被终止处恢复。所有其他 Activity / Fragment 也将重新创建。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
所有其他 Activity / Fragment 也将重新创建
=>所有其它活动或片段(Activity/Fragment)也将重新创建
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
|
||
App Crashes due to process-kill are very common on the Android platform. With newer Android versions, it is observed that background apps are killed aggressively to save on phone battery. | ||
在 Android 平台上,由于进程终止导致的应用崩溃是很常见的。而如果我们使用较新的 Android 版本,我们可以观察到后台应用程序被大量结束以节省手机电池。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们可以观察到后台应用程序被大量结束以节省手机电池
=>我们可以发现后台应用程序被大量结束运行以节省手机电源
@PassionPenguin @lsvih 文章很棒,提了一点小建议 |
Co-authored-by: HumanBeing <[email protected]>
assign proofreading to @HumanBeingXenon |
Co-authored-by: zenblo <[email protected]>
已修正 @zenblo :) |
@lsvih 校对认领 |
@HumanBeingXenon 欢迎校对 |
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
|
||
This is a problem and before we move on to the solution, let us replicate this scenario. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加“这是个问题。在我们继续讨论解决方案之前,让我们复现一下这种情况。”
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
Co-authored-by: HumanBeing <[email protected]> Co-authored-by: HumanBeingXenon <[email protected]>
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
@lsvih @HumanBeingXenon 校对完成啦 🍻 |
@@ -2,80 +2,77 @@ | |||
> * 原文作者:[Kunal Chaubal](https://medium.com/@kunalchaubal) | |||
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner) | |||
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md](https://github.com/xitu/gold-miner/blob/master/article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md) | |||
> * 译者: | |||
> * 译者:苏苏的 [PassionPenguin](https://github.com/PassionPenguin/) | |||
> * 校对者: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加校对者信息
还有统一一下“你”和“您” |
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
article/2020/unexpected-app-crashes-on-android-and-how-to-deal-with-them.md
Outdated
Show resolved
Hide resolved
Co-authored-by: lsvih <[email protected]>
@lsvih 修好啦~ |
@PassionPenguin 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
本文已获得原作者转载、修改的权限,转载请注明原作者以及原文链接 |
译文翻译完成,resolve #7161 @lsvih