ActivityThread main
2016-07-30 16:37
381 查看
public static void main(String[] args) { Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "ActivityThreadMain"); SamplingProfilerIntegration.start(); // CloseGuard defaults to true and can be quite spammy. We // disable it here, but selectively enable it later (via // StrictMode) on debug builds, but using DropBox, not logs. CloseGuard.setEnabled(false); Environment.initForCurrentUser(); // Set the reporter for event logging in libcore EventLogger.setReporter(new EventLoggingReporter()); AndroidKeyStoreProvider.install(); // Make sure TrustedCertificateStore looks in the right place for CA certificates final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId()); TrustedCertificateStore.setDefaultUserDirectory(configDir); Process.setArgV0("<pre-initialized>"); Looper.prepareMainLooper(); ActivityThread thread = new ActivityThread(); thread.attach(false); if (sMainThreadHandler == null) { sMainThreadHandler = thread.getHandler(); } if (false) { Looper.myLooper().setMessageLogging(new LogPrinter(Log.DEBUG, "ActivityThread")); } // End of event ActivityThreadMain. Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); Looper.loop(); throw new RuntimeException("Main thread loop unexpectedly exited"); }
相关文章推荐
- App入口(ActivityThread.main):mgr.attachApplication(mAppThread);
- java.lang.RuntimeException: Unable to start activity ComponentInfo....android.os.NetworkOnMainThread
- startActivity -进程不在->创建进程->ActivityThread.main->启动主线程消息循环
- 在Activity中启动一个网络连接遇到android.os.NetworkOnMainThreadException
- 【Android】init -> Zygote(app_main) -> SystemServer(SystemServer.main)/AppProcess(ActivityThread.main)
- ActivityThread——main方法
- 【转载】Android 3 开始 Activity MainThread中不能执行http通信了
- 命令行出错Exception in thread "main" java.lang.UnsupportedClassVersionError
- 关于MBP 加载菊花 崩溃到 MBP.m 报: MBProgressHUD needs to be accessed on the main thread.
- Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission denied: use
- MyEclipse启动Tomcat出现Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
- performSelectorOnMainThread 和detachNewThreadSelector区别
- Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com.xzhl.user.model/Stu
- 安卓4.0以后主线程访问网络问题(NetworkOnMainThreadException)解决方法及子线程更新ui
- 在Activity中使用Thread导致的内存泄漏
- Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/Eleme
- android错误之android.os.NetworkOnMainThreadException
- Android之NetworkOnMainThreadException异常
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
- Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path