3

I'm trying to figure our what kind of components this description in the android documentation is referring to. Why would the android system try to instantiate components inside my application?

android:enabled

Whether or not the Android system can instantiate components of the application — "true" if it can, and "false" if not. If the value is "true", each component's enabled attribute determines whether that component is enabled or not. If the value is "false", it overrides the component-specific values; all components are disabled. The default value is "true".

EGHDK
  • 17,818
  • 45
  • 129
  • 204

1 Answers1

3

Why would the android system try to instantiate components inside my application?

Every time a component of your app runs, it was instantiated by the system, with the sole exception of a BroadcastReceiver registered via registerReceiver(). So, for example, every time something calls startActivity() on one of your activities, the system instantiated your component.

Now, if your question is "well, why would they have android:enabled at the application level?", that I can't explain. I've long suspected that they had a vision, way back when, that an APK could hold multiple applications, though that's never been supported. FWIW, I've filed a documentation issue on this point.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • As a note, this was in my application and I couldn't run my application afterwards `android:enabled="false"`. Error Code 3 as seen here: http://stackoverflow.com/questions/2677643/cannot-run-android-application-on-emulator-device-activity-doesnt-exist – EGHDK Aug 07 '13 at 15:14