3

You can get the resource name as shown here: https://stackoverflow.com/a/10138018/1489968

But unfortunately getResourceEntryName(R.layout.xzy) is returning xyz and getResourceName(R.layout.xzy) is returning package:layout/xyz.

Is there any function that returns the active configuration qualifier for a given resource id using the best match algorithm?

For my test I need the following information:

  • resource type (e.g. layout)
  • active configuration qualifier (e.g. -v21)
  • (or better both of them combined like layout-v21)
  • resource identifier (e.g. xyz)

I found Resources.getConfiguration() that seem to give me a configuration. But I can't figure out a way to get the selector for a given id.

Community
  • 1
  • 1
Sven-Michael Stübe
  • 14,560
  • 4
  • 52
  • 103

0 Answers0