Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
string.xml 内に文字列の配列を作成する方法と、Java コードでそれにアクセスする方法を知りたいです。setText() を使用するには、これが必要です。助けてください。
次のように、strings.xml に String 配列を作成します。
<string-array name="my_string_array"> <item>first string</item> <item>second</item> </string-array>
そして、次の方法でアクセスできます。
String[] str = getResources().getStringArray(R.array.my_string_array);