Does an android widget run in the same process as

2019-03-27 12:31发布

问题:

I want to create a bound service for my app and would like it to be available for a widget to use in the future should i decide to create one. In order to decide whether to use a Messenger or extend Binder i need to know whether a widget and its corresponding app run in the same process?

Thanks

David

回答1:

Yes. Unless you specify otherwise in the manifest (using android:process="..."), all components of an application (widget providers, services, activities, broadcast receivers) run in the same process, use the same Virtual Machine and run in the same memory space.