java - While saving data to mysql from my android app it removes spaces -


suppose have field in full_name. between firstname , lastname there should space. when enter -- tom cruise ,,, gives error ,, shows . takes tomcruise nicely. here code. dont have trim function. why can not save white spaces.

activity_main.xml

<textview     android:text="full name"     android:layout_width="wrap_content"     android:layout_height="wrap_content" /> 

mainactivity.java giving cruicial part.

private edittext edittextname;   edittextname = (edittext) findviewbyid(r.id.edittextname);  string name = edittextname.gettext().tostring();  string urlsuffix = "?name="+name+"&username="+username+"&password="+password+"&email="+email; 

i sending php site , save it. works fine if remove space between words.

just replace space character "%20". name = name.replace(" ","%20");


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -