Passing multiple strings to a new activity and displaying them in a list view. Java, Android SDK -
i have 2 activities set , linked.
what i'm trying do:
take generated text view in first activity, convert string, pass other activity, displayed in list view other previous passed text views.
so in first activity have:
public void savemessage(view view) { string saved = message.gettext().tostring(); intent intent = new intent(firstactivity.this,secondactivity.class); intent.putextra("message",message); toast.maketext(getapplicationcontext(), r.string.addedfavs, toast.length_short).show(); }
however don't know go this, i've looked @ trying store strings in arrays or in array lists, no avail.
help appreciated on how receive each string , store in sort of arraylist (as arrays of fixed size) or format consequently displayed in listview.
however don't know go this,
first of must start intent activity:
context.startactivity(intent);
then, when necessary, in firstactivity
or secondactivity
, intent started activity with:
intent intent = getintent();
now, have extras intent. have data string
s, use intent.getstringextra(string name)
method.
in case:
string message = intent.getstringextra("message");
i've looked @ trying store strings in arrays or in array lists, no avail.
you have other methods getstringarraylistextra
pass arraylist<>
or getstringarrayextra
pass arrays
Comments
Post a Comment