A String _is_ a CharSequence. There is no need for a cast.

On Mar 19, 3:35 pm, Will <[email protected]> wrote:
> Cast the String to a CharSequence.
>
> String x = "foo";
> EditText ET;
> ET.setText((CharSequence) x);
>
> On Mar 19, 10:43 am, Lovedumplingx <[email protected]> wrote:
>
> > Ok...so I've scoured and scoured and played and fiddled but I can't
> > figure it out.
>
> > I want to allow the user to set preferences for an application and I
> > want the preferences to be displayed in the EditText area if/when they
> > come back to change them again.
>
> > In my head I'm thinking I would be able to use setText() but no...that
> > takes a CharSequence and I have a string and don't know how to make a
> > CharSequence (which according to what I've read is supposed to be a
> > read-only thing anyway).
>
> > So...does anyone know how to put text into an EditText field without
> > relying on the XML?  I really want to do this via application
> > preferences.
>
> > Thanks.

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