Difference between getString() and getResources.getString()

前端 未结 3 1373
闹比i
闹比i 2020-12-01 05:57

I noticed that the Activity class has two different methods to get a String resource. This is possible by using:

  • getString(int resId)

3条回答
  •  盖世英雄少女心
    2020-12-01 06:48

    They are the same as Activity.getString(int) does exactly that:

     public final String getString(int resId) {
         return getResources().getString(resId);
     }
    

提交回复
热议问题