How to get String Resource within ViewPager Adapter?

后端 未结 9 1883
孤城傲影
孤城傲影 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:46

    If it is not allowed to call getResources() in your viewPager Adapter, you need to declare it as a static variable in the parent activity

提交回复
热议问题