title: How do I get getString in fragment?
body: <p>How do I get getString in fragment, I have tried to solve it with snippets of code on this but it did not work to tap</p>
  
  <p><strong>chronology</strong>
  -ok so in the uploaded image there are some 6 items in the recyclerview that line up the grid, I try to make it to the String of the name as I have included the code but the code I press [commant + tap] displays the message {public statuc int} , but it can't be tapped to go to the next page, but if I try to use the usual string as I have included the code, it works on the next page</p>
  
  <p>get an error  <em>public static int</em></p>
  
  <pre><code>dataProduct.add(Products(R.drawable.ic_electricity, getString(R.string.electricity), true))
  </code></pre>
  
  <p>I've looked for a solution in this forum but it still hasn't worked, but if I use the code below it works</p>
  
  <pre><code> dataProduct.add(Products(R.drawable.ic_electricity, "Electricity", true))
  </code></pre>
  
  <p>maybe I'll send a picture, below, in this case I will take the string but can't be tapped like the image below</p>
  
  <p><a href="https://i.stack.imgur.com/J5gFz.png" rel="nofollow noreferrer">image getString</a></p>