0

I have a service and I run a thread inside it. When I try to reference the strings.xml I receive "can't resolve symbol R", I am able to reference the same resources from another class in the application.

Please let me know how can I reference resources "strings.xml" correctly

code

SystemClock.sleep(getApplicationContext().getResources().getString(R.string.int_short_max_wait_time));
Alok Gupta
  • 1,353
  • 1
  • 13
  • 29
Amrmsmb
  • 1
  • 27
  • 104
  • 226

1 Answers1

0

i solved it by qualifying the R class with the package name followed by the App name, as follows, if your package is named: com.example.com and your App is named: AppTest, then qualify the R class as follows: com.example.com.AppTest.R.xx

code:

 SystemClock.sleep(getApplicationContext().getResources().getString(com.example.com.AppTest.R.string.int_s
hort_max_wait_time));
Amrmsmb
  • 1
  • 27
  • 104
  • 226