8
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Android:java]strings.xmlから文字列を取得する方法(string、string-array)

Last updated at Posted at 2015-12-03

必要にかられてAndroid開発してます。初歩的な内容ですが絶対使用します。
すぐわすれるのでまとめます。

string

<string name="hoge">ほげ</string>

<string-array name="hoge_array">
    <item>ほげ1</item>
    <item>ほげ2</item>
</string-array>

string

getString(R.string.hoge);

string-array

getResources().getStringArray(R.array.hoge_array)

まとめ

とくにまとめはいらないですね。
言いたいことはAndroid難しいということです。

8
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?