什么是ZygoteInit电话? [英] What are ZygoteInit calls?

查看:113
本文介绍了什么是ZygoteInit电话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我定期报告获得Android电子市场中的异常是不重复的。该堆栈跟踪总是以这样的:

Periodically I get Exceptions reported on Android Market that aren't reproducible. The stack traces always begin like this:

at ...
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4306)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

ZygoteInit $ MethodAndArgsCaller似乎被调用的应用程序的方法,而不是直接通过code。怎么会出现这种情况?

ZygoteInit$MethodAndArgsCaller appears to be calling app methods directly instead of through code. How is this happening?

终于重现这些例外情况如下之一:触摸应用程序图标,轻触文本框,弹出对话框,preSS家,杀了应用程序的PID,触摸应用程序图标,preSS返回。增加了保存和恢复中的onSaveInstanceState和onRestoreInstanceState应用程序实例变量来解决问题。

Finally reproduced one of these exceptions as follows: touch app icon, touch text field to bring up dialog, press Home, kill app pid, touch app icon, and press Back. Added saving and restoring of app instances variables in onSaveInstanceState and onRestoreInstanceState to fix problem.

还是想找到ZygoteInit描述调用的地方。

Would still like to find description of ZygoteInit calls somewhere.

推荐答案

拉尔斯·沃格尔介绍了在Android的受精卵过程中的作用的这篇文章

Lars Vogel describes the role of the Zygote process during Android's start up in this article:

在Android系统中启动Linux内核首先调用   进程初始化。 init读取文件/init.rc和init.device.rc。   init.device.rc是设备特定的虚拟设备文件上   被称为init.goldfish.rc

During startup of the Android system the Linux kernel first calls the process "init". init reads the files "/init.rc" and "init.device.rc". "init.device.rc" is device specific, on the virtual device this file is called "init.goldfish.rc".

init.rc通过程序启动进程合子   /系统/斌/ app_process。受精卵加载核心Java类和   执行其中的初始处理。这些类可以通过重复使用   Android应用程序,因此,这一步使他们更快地   开始。一旦受精卵的初始工作完成,则处理监听   一个套接字,并等待请求。

init.rc starts the process "Zygote" via the program "/system/bin/app_process". Zygote loads the core Java classes and performs initial processing of them. These classes can be reused by Android application and therefore this step makes them faster to start. Once the initial work of Zygote is done, the process listens to a socket and waits for requests.

这篇关于什么是ZygoteInit电话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆