snip-code from values/string.xml:
<array name="categories">
<item name="today">Today</item>
<item name="life">Life</item>
<item name="corner">Corner</item>
<item name="banks">Banks</item>
<item name="it">IT</item>
<item name="fun">Fun</item>
</array>
snip-code from layout/main.xml:
<Button
android:id="@+id/today"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="8sp"
android:text="@array/categories"
/>
Is it possible to assign a label-name to a Button with id=today directly from values/string.xml using string-array with name=categories and specific item, in this case - today?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…