-5
LayoutInflater inflater = getLayoutInflater();
view1 = inflater.inflate(R.layout.item_drawer_im`enter code here`age,null);
RoundedImageView imageView1 = (RoundedImageView) view1.findViewById(R.id.photo);
Picasso.with(com.muzoly.vkmusic.AudioList.this)
        .load(vkApiUsers.get(0).photo_200)
        .into(imageView1);
TextView textView = (TextView) view1.findViewById(R.id.text);
textView.setText(vkApiUsers.get(0).first_name + " " + vkApiUsers.get(0).last_name);
mDrawerLayout.setDrawerListener(createDrawerToggle());
String arr[] = {"Популярное", "Мои аудиозаписи", "Рекомендации", "Загрузки","Настройки"};
mDrawerList.setAdapter(null);
mDrawerList.addHeaderView(view1);

this my AudioList.java file. I want get array texts from string.xml file.

What is the java code?

technophobia
  • 2,644
  • 1
  • 20
  • 29

1 Answers1

-1

Solved! Thank you!

java code:

String arr[] = getResources().getStringArray(R.array.menuu);

strings.xml

 <string name="popular">Pop</string>
    <string name="recommend">Рекоммендации</string>
    <string name="my_audios">Мои аудиозаписи</string>
    <string name="settings">Настройки</string>
    <string name="downloads">Загрузки</string>

    <string-array name="menuu">
        <item>@string/popular</item>
        <item>@string/recommend</item>
        <item>@string/my_audios</item>
        <item>@string/settings</item>
        <item>@string/downloads</item>
    </string-array>