How to get String Resource within ViewPager Adapter?

后端 未结 9 1889
孤城傲影
孤城傲影 2020-12-31 07:42

I trying to set the title for my viewpager, I can\'t seem to get it to work. I tried Resources.getSystem().getString(R.string.title1); and also tried to pass a context. Coul

9条回答
  •  情歌与酒
    2020-12-31 08:30

    Just use the available using: getContext().getString(resId) like:

    getContext().getString(R.string.title1)
    

    It worked for me.

提交回复
热议问题