I want to make a view have text with two different colors so I'm trying this code inside my fragment
TextView welcome = (TextView) view.findViewById(R.id.welcome_text_ID);
View sample = getActivity().findViewById(R.string.sample);
welcome.setText("Welcome to " + sample);
and it says "Welcome to null"
Then I tried this
TextView welcome = (TextView) view.findViewById(R.id.welcome_text_ID);
welcome.setText("Welcome to " + (R.string.sample));
and i get "Welcome to x1029203"
Which is the reference of the int
of that string
value found in the actual R.java
file. Any help is appreciated thanks.