How can I access the R class from classes that were not inherited from Activity. So when I write R.something, I implicitly call android.R.something.
What is the explicit way of call R.something?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just import the version of
Rthat you want. If you need to access values in both classes, at least one of them will have to be fully qualified.Note that inheriting from
Activityhas nothing to do with using you project’sRvalues without animportstatement. It’s whether the code is in the application package as declared in the manifest.