I have TextView with text that changed dynamically. i want tokenizing this text with delimiter space " " and send to another textview
this is my code
public void onClick(View v) {
// TODO Auto-generated method stub
if (v.getId()==R.id.button5){
Intent i = new Intent(this, Tokenizing.class);
String test = ((TextView)findViewById(R.id.textView6)).getText().toString();
String result = null;
StringTokenizer st2 = new StringTokenizer(test," ");
while (st2.hasMoreTokens()) {
String st3 = st2.nextToken();
System.out.println(st3);
result = st3;
}
i.putExtra("result", result);
startActivity(i);
Log.i("Test Klik Next", result);
but i have just last word in the textview. text before tokenizing:
Examples of paradoxes can be humorous and confusing
text after tokenizing:
confusing
where is the part of my coding is wrong?