1

I would like to know if it is possible to recognize, if id is from drawable or strings resource.

For example: If I call R.strings.hello that return int value `2131099681.

Can i recognize that the id is from strings folder?

Apoorv Mehrotra
  • 607
  • 5
  • 13

2 Answers2

1

I guess you could use (in activity)

getResources().getResourceTypeName(int resid);

As suggested here

Community
  • 1
  • 1
Filipe Silva
  • 220
  • 4
  • 10
0

Give this a try

Resources.getResourceTypeName(int resid)

Docs here

Sid
  • 14,176
  • 7
  • 40
  • 48