我在AndroidManifest.xml中注册了一个ContentProvider,甚至在Application.onCreate()之前调用了ContentProvider.onCreate().在我看来,我不理解这种行为,在应用程序中的任何组件之前调用Application.onCreate()更自然.有人能告诉我Application.onCreate()和其他组件'onCreate()被调用的时间吗?
在此页面中,http://androidapps.org.ua/androidintro_ipc.html,活动之间的意图切换被描述为进程间通信.现在我很困惑每个活动是否是android中的单独进程或应用程序内的所有活动都是一个进程.我使用以下方法检查了我的应用程序中所有活动和服务的进程ID:
int id = android.os.Process.myPid();
System.out.println("Process id of Activity1 :"+id);
Run Code Online (Sandbox Code Playgroud)
但它显示相同的进程ID.请回复.