By putting the setText() inside the for loop, it will always replace existing content with the one from subsequent iteration. That is the mistake. The correct way is to do the reversal of words in the for loop, then display the final reversed words as string in the edit text control only after the end of the for loop. Try this:
String sen = "Welcome to Code Project";
String[] senRev = sen.split("\\b");
StringBuilder builder=new StringBuilder();
for (int n = senRev.length - 1; n >= 0; n--)
{
builder.append(senRev[n]);
}
TextView main2TextView1 = (TextView)findViewById(R.id.main2TextView1);
main2TextView1.setText(builder.toString());