我正在通過PackageManager API。我覺得定義的以下常量:Android - PackageManager標誌
1) GET_DISABLED_COMPONENTS
2) GET_DISABLED_UNTIL_USED_COMPONENTS
3) COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
4) COMPONENT_ENABLED_STATE_DISABLED_USER
5) COMPONENT_ENABLED_STATE_DISABLED
6) COMPONENT_ENABLED_STATE_DEFAULT
7) COMPONENT_ENABLED_STATE_ENABLED
8) GET_UNINSTALLED_PACKAGES
在閱讀documentation,我看到了常數5-7組件已啓用/禁用不管它是如何在清單文件中指定。
對於3,本細則說:
This application should be considered, until the point where the user actually
wants to use it.
這是什麼意思?
對於4,單證說:
The user has explicitly disabled the application, regardless of what it has
specified in its manifest.
如果這個標誌涉及到應用程序,爲什麼這個名字開始與「組件」?用戶如何禁用應用程序?
爲8,文件說:
Flag parameter to retrieve some information about all applications (even
uninstalled ones) which have data directories. This state could have
resulted if applications have been deleted with flag DONT_DELETE_DATA with
a possibility of being replaced or reinstalled in future.
如果指定了DONT_DELETE_DATA標誌?總之,如果有人可以請開發人員解釋這些常量的用例,這將會有所幫助。
謝謝。
能否請您詳細闡述項目中的使用情況。請使用哪個標誌,並請解釋上述標誌的模糊含義。 – Gem
我編輯了我的答案來闡述這些觀點。 – Simon