That's almost it. but you need to cast your View as a TextView :
TextView currentRankText =
(TextView)  this.findViewById(R.id.currentRankLabel);
currentRankText.setText("some text");

2009/4/13 kaloer <[email protected]>

>
> Hi,
>
> 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");
>
> Best Regards,
> Kaloer
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to