I am not getting to how to know to which layout it is point because instead of giving the full name like r.layout.activity_main
it has given the id in the form of integer.
How to get the location if the integer id is given how to convert it?
I am not getting to how to know to which layout it is point because instead of giving the full name like r.layout.activity_main
it has given the id in the form of integer.
How to get the location if the integer id is given how to convert it?
To get the full id like R.id.your_id
you have to make two calls:
getActivity().getResources().getResourceEntryName(int);
Which returns the identifier your_id
getActivity().getResources().getResourceTypeName(int);
Which returns the type of the resource like id
, string
, layout
As a note: Make sure the id with the corresponding value exists! Otherwise you will get a NotFoundException
.