如何在 glance appWidget 中使用复数字符串资源?

huangapple go评论48阅读模式
英文:

How to use plural string resource with glance appWidget?

问题

如何在小部件中应用我的复数字符串资源?
上下文中没有这样的扩展。

英文:

How to apply my plural string resources in widget?
There is no such extension in context.

答案1

得分: 0

现在我成功地通过应用程序上下文获取了复数资源,就像这样:

context.applicationContext.resources.getQuantityString(R.plurals.month, number, number)

我知道这是一个临时解决方案,我希望Glance团队会继续开发他们的产品。

英文:

In case somebody also will need this.
Now I managed to get plurals resources through app context like this

context.applicationContext.resources.getQuantityString(R.plurals.month,
number, number)

I know this is temp solution, I hope Glance team will continue to develop their product.

huangapple
  • 本文由 发表于 2023年6月5日 23:15:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407831.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定