Skip to content
Advertisement

how to get string from string.xml in adapter class on click method

I want to get string in my adapter class on view holder in on click method my app crash when i implement the code write below in on click if(postion==1).

JavaScript

Advertisement

Answer

If you look at the docs you’ll see that Resources.getSystem().getStrings will provide you with system wide strings, not the ones in your application (strings.xml).

Replace the following line

JavaScript

with the following.

JavaScript
Advertisement