android - How to pass values of StringBuffer to different Activities using Intent -
code of stringbuffer
data:
stringbuffer finalbufferdata = new stringbuffer(); (int = 0; < parentarray.length(); i++) { jsonobject finalobj = parentarray.getjsonobject(i); string id = finalobj.getstring("student_id"); string name = finalobj.getstring("first_name"); string m_name = finalobj.getstring("middle_name"); string l_name = finalobj.getstring("last_name"); finalbufferdata.append(id+" "+name+" "+m_name+" "+l_name+"\n"); }
well, depends on goal is. pass along string
(this preferred way):
stringbuffer finalbufferdata = new stringbuffer(); .... intent intent = new intent(); intent.putextra("your_key_here", finalbufferdata.tostring());
if needed it, stringbuffer
implements serializable
, charsequence
should able pick 1 , add directly intent so:
stringbuffer finalbufferdata = new stringbuffer(); .... intent intent = new intent(); intent.putextra("your_key_here", (serializable) finalbufferdata);
if more specific need, may able more.
Comments
Post a Comment