Use resources)
Android platform, available for useLocal resources, You can also useSystem Resources;
UseStatic R classAccess resources. The R class contains a static subclass.Each subclassAll indicate its related resourcesVariableForm;
Resource tableAInstance;
:
UseGetResources ()Method, access the instance, and every available resource containsGetter ()Method;
Use@ SymbolIn a resource.ReferenceAnother resource;
For example:
UseAndroid. RAvailableSystem Android Resources, You must specifyAndroid as a packageName, use@ Android:, AndNo @;
UseTheme Style, You need to use? Android:, YesFollow the topic to change the style;
Yes.Dynamic Resource Selection Mechanism, SuchDpi resourcesBut you needCustom Resource Value, Which must meet the resource valueSequenceAnd ensure the categoryUniqueness;
:
You can change the configuration at runtime.Activity (activity_main, Layout), Indicating the handling of some configuration changes,
AndProgram (MainActivity. java), InputConfiguration objectTo determine the new configuration value;