I just want to reverse a inputted String by using for loop. I have tried the following code below. [ its full of mistake i think.. cause i dont know how to convert things to array or to string in this problem ]. So anyone please help me the coding here...
public class Main extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView) findViewById(R.id.textView1);
EditText input_string =(EditText) findViewById(R.id.editText1);
final String orig = input_string.getText().toString();
Button rev = (Button) findViewById(R.id.button1);
rev.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
int limit = orig.length();
for(int i=limit;i<=limit;i--)
{
String[] neww = orig[i].;
}
tv.setText(neww);
}}) }}