I want to get text from Edit text as it is and display in TextView.But whenver i get text using getText() it gives me text in one line. How to entered text in multiline EditText as it is. Please give me guidance?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Rajendar,
I don’t understand why you’re having this issue. When you obtain a piece of text out of an EditText it should keep “formatting” such as line breaks.
For instance, try this code (I tested it myself)!
main.xml
main.java
Both Toast and TextView keep line breaks. You can try it yourself.
Maybe if you post your code (the relevant bits, at least) we can help you.