Androidのstrings.xmlファイル内で定義された文字列をランダムに選択する必要があります。Androidのstrings.xmlからランダムに文字列を選択してください
例えば私のstrings.xmlは次のとおりです。
<resources>
<string name="str1">Content comes here1</string>
<string name="str2">Content comes here2</string>
<string name="str3">Content comes here3</string>
</resources>
私はランダムに私の活動にこれらの文字列のいずれかを選択することはできますか?
文字列はリソースなので、** int [] strs = {R.string.str1、R.string.str2、R.string.str3}; **そして、手順3ではdo ** int resId = strs [randomIndex]; ** –