That's what I thought too but I crash the task every time the activity that contains this code is started:
EditText userText = (EditText) findViewById(R.id.userText); userText.setText(userParam); This is the basic way I thought to have the value set but it crashes every time. On Mar 19, 10:53 pm, Isaac Waller <ad...@isaacwaller.com> wrote: > A String _is_ a CharSequence. There is no need for a cast. > > On Mar 19, 3:35 pm, Will <sem...@gmail.com> wrote: > > > Cast the String to a CharSequence. > > > String x = "foo"; > >EditTextET; > > ET.setText((CharSequence) x); > > > On Mar 19, 10:43 am, Lovedumplingx <lovedumpli...@gmail.com> 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 theEditTextarea 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 anEditTextfield 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 android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---