1

我有这样的字符串数组:

<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string-array name="my_videos">
    <item>bunny.mp4</item>
    <item>bunny.m4a</item>
    <item>bunny.3gp</item>
</string-array>

在我的应用程序中,我有这个:

String product = ((TextView) view).getText().toString();

现在我想放一些像这样的普通文本:

<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string-array name="my_videos">
    <item name="bunny.mp4">Movie description 1</item>
    <item name="bunny.m4a">Movie description 2</item>
    <item name="bunny.3gp">Movie description 3</item>
</string-array>

现在我想访问名称属性而不是获取文本。我是 Android 新手,不知道这是否可行。

请帮忙。

4

0 回答 0