setText(getString(R.strings.whatever) or setText(R.strings.whatever)?

后端 未结 3 518
傲寒
傲寒 2020-12-19 08:56

Both work, obviously if you start concatenating you\'ll need get string in order to avoid displaying an int.

Question: which is the most \'elegant\' or \'recommende

3条回答
  •  囚心锁ツ
    2020-12-19 09:07

    Well, since the API provides a method to pass Resource String ID, It seems to be logical to prefer using this. You could actually check the working of setText(resourceid) to see beneath the hood, but setText(R.strings.whatever) is definitely recommended.

提交回复
热议问题