R.string.value Help android notification

后端 未结 4 1147
粉色の甜心
粉色の甜心 2021-02-12 10:48

whats the deal with

 CharSequence contentTitle = R.string.value;

Error cannot convert from int to CharSequence. Is there a way around this or a

4条回答
  •  庸人自扰
    2021-02-12 11:22

    R.string.value is a call to the static field in the class R, which is auto generated by Eclipse and which does a kind of summary of all your resources. To retrieve the string, you need to use :

    CharSequence contentTitle = getString(R.string.value);
    

    If you open the R class you will see that it contains only numbers that are references to the compiled resources of your project.

提交回复
热议问题