1

i'm reading the textfile(html tag file) in android and i trying to convert it into html. i'm getting error when i setText in textView(output).. The method setText(String, TextView.BufferType) is undefined for the type StringBuffer how to change StringBuilder to String to get ouput...

String s = "";
            StringBuilder str=null;
            while ((s = buffer.readLine()) != null){
                str.append(s+"/n");}
            String a=str.toString().trim();
            Spanned marked_up = Html.fromHtml(a);

            output.setText((marked_up).toString(),BufferType.SPANNABLE);

plz help ...

1
  • I tried the same u have done but this doesnot work with android but possible with ios. Try making to different String and then Use it along .If u need help do let me know Commented Aug 31, 2013 at 6:07

1 Answer 1

1

Try like this. (To display HTML in the TextView Component)

myTextView.setText(Html.fromHtml(a));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.