Resources.getSystem() vs getResources()

后端 未结 3 2116
死守一世寂寞
死守一世寂寞 2021-02-07 07:10

I am new to Android and I am learning the SDK myself from resource available over the net.

I came across a situation now. I am trying the below code:

Type 1:

3条回答
  •  自闭症患者
    2021-02-07 07:22

    These three methods are all the same. Here is the root method : getApplicationContext().getResource().getString("") and here is shortcut method : getString("") Use the shortcut method when you are processing on apps context. In almost every case, we use getString() to get Strings defined in the String file.

提交回复
热议问题