In my android app, I am getting the String from an Edit Text and using it as a parameter to call a web service and fetch JSON data. Now, the method I use for getting the String value from Edit Text is like this :
final EditText edittext = (EditText) findViewById(R.id.search);
String k = edittext.getText().toString();
Now normally it works fine, but if we the text in Edit Text contains space then my app crashes.
for eg. - if someone types "food" in the Edit Text Box, then it's OK but if somebody types "Indian food" it crashes.
How to remove spaces and get just the String ?