ActivityThread main

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");}
时间: 2024-10-08 10:28:53

ActivityThread main的相关文章

Android ActivityThread(主线程或UI线程)简介

1. ActivityThread功能 它管理应用进程的主线程的执行(相当于普通Java程序的main入口函数),并根据AMS的要求(通过IApplicationThread接口,AMS为Client.ActivityThread.ApplicationThread为Server)负责调度和执行activities.broadcasts和其它操作. 在Android系统中,在默认情况下,一个应用程序内的各个组件(如Activity.BroadcastReceiver.Service)都会在同一个

【BUG】&quot;main&quot; prio=5 tid=1 RUNNABLE

加载超大效果图导致内存不足(GC/ANR) 06-30 11:42:56.624: D/dalvikvm(16264): GC_CONCURRENT freed 1982K, 7% free 45372K/48775K, paused 1ms+3ms, total 50ms 06-30 11:42:57.469: D/DeviceTrackActivity(16264): onPause() 06-30 11:42:57.994: D/dalvikvm(16264): GC_CONCURRENT

【BUG】&amp;quot;main&amp;quot; prio=5 tid=1 RUNNABLE

载入超大效果图导致内存不足(GC/ANR) 06-30 11:42:56.624: D/dalvikvm(16264): GC_CONCURRENT freed 1982K, 7% free 45372K/48775K, paused 1ms+3ms, total 50ms 06-30 11:42:57.469: D/DeviceTrackActivity(16264): onPause() 06-30 11:42:57.994: D/dalvikvm(16264): GC_CONCURRENT

【转】应用程序的入口是ActivityThread

ActivityThread运行框架 在分析中,我们可以看到真正对应应用进程的不是Application而是ActivityThread.我们从实际的应用堆栈可以看到: NavitiveStart.main() ZygoteInit.main ZygoteInit$MethodAndArgsCall.run Method.Invoke method.invokeNative ActivityThread.main() Looper.loop() .... 每个应用程序都以ActivityThre

android主线程ActivityThread

ActivityThread在Android中它就代表了Android的主线程,但是并不是一个Thread类. 源码如下: http://androidxref.com/6.0.0_r1/xref/frameworks/base/core/java/android/app/ActivityThread.java public final class ActivityThread { //... final H mH = new H(); final ArrayMap<IBinder, Activ

数组越界 —— 解决方法

java.lang.ArrayIndexOutOfBoundsException: length=3; index=3 at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6588) at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4941) at android.widget.AbsListView$FlingRunnabl

我的Android进阶之旅------&gt;Java字符串格式化方法String.format()格式化float型时小数点变成逗号问题

今天接到一个波兰的客户说有个APP在英文状态下一切运行正常,但是当系统语言切换到波兰语言的时候,程序奔溃了.好吧,又是我来维护. 好吧,先把系统语言切换到波兰语,切换到波兰语的方法查看文章 我的Android进阶之旅------>Android[设置]-[语言和输入法]-[语言]列表中找到相应语言所对应的列表项 地址:http://blog.csdn.net/ouyang_peng/article/details/50209789 ================================

(未解决)问题记录ionic android 签名之后安装到手机上点击运行出现闪退,不签名运行正常

Log日志如下: 06-21 10:12:52.495: E/Trace(2682): error opening trace file: No such file or directory (2) 06-21 10:12:52.723: E/AndroidRuntime(2682): FATAL EXCEPTION: main 06-21 10:12:52.723: E/AndroidRuntime(2682): java.lang.RuntimeException: Unable to st

【Android应用开发】 Android 崩溃日志 本地存储 与 远程保存

示例代码下载 : http://download.csdn.net/detail/han1202012/8638801; 一. 崩溃日志本地存储 1. 保存原理解析 崩溃信息本地保存步骤 : -- 1. 自定义类实现 UncaughtExceptionHandler : public class CrashHandler implements UncaughtExceptionHandler; -- 2. 设置该自定义的 CrashHandler 类为单例模式 : // 单例模式 private