> I have made a layout in Xml, which includes a TextView. The TextView
> should show some text that is found in a database. Therefore, i cannot
> find the text by using the @string/something. How can i define the
> text from my code, without creating the whole layout in code?
>
> My TextView has the id "currentRankLabel".
>
> I think i shall do something like this:
>
> View currentRankText = this.findViewById(R.id.currentRankLabel);
> currentRankText.setText("some text");
That should work fine, so long as you call findViewById() sometime after
setContentView() or otherwise inflating your layout.
--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---