Hi all,

I want to get the string resource with R refference like R.string... but there is an issue that my class is not an activity.

deviceNameEditor.setText(settings.getString(Constants.LOCAL_DEVICE_NAME, <def_val> ));

how can I use the def value setten in the strings by using R.string indicator.

since R.string will return a int ref. to the string value I am just get lost :(

Edited by peter_budo: Keep It Clear - Do wrap your programming code blocks within code tags

7 Years
Discussion Span
Last Post by annttiigs

A) Provide this as parameter when calling upon this class (meaning before you call the class, you retrieve reference and then just forward it to class)
B) When calling class provide instance of activity as one of the parameters of call (this will allow you to use activity directly from simple class)

However "A" woud be more desirable approach



thanks. I find a solution to my problem.

I sent the context to the layout drawer class ( sipmly ) and solved the issue.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.