3

Is it possible to get string resources from a repository (like HashTable, List etc. ) not strings.xml? Desired usage in layouts like

<EditText android:id="@+id/inputSearch"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="@StringRepository.GetMessage("Search")"
        android:inputType="textVisiblePassword"/>

My challenge is maintain string values on application server (web) and refresh all string resources (both layout and java side) without version updating.

I tried to traverse all Views on onCreate method of Activity instance, but couldn't find a solution for dynamically created Views.

Any help to achieve this challenge would be appreciated.

1 Answer 1

2

No. The @resource syntax only works with XML defined resources. If you want to define your strings in a hashmap, you will need to set the hint/text of your views in code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.